posadautil
Class VectorPos

java.lang.Object
  |
  +--posadautil.VectorPos

public class VectorPos
extends java.lang.Object

Libreria de metodos para arreglos unidimensionales (vectores).

Version:
2.2 24/09/2001 (throw)
Author:
Omar Posada Villarreal

Constructor Summary
VectorPos()
           
 
Method Summary
static double absoluteNorm(double[] vectorX)
          Calcula la norma absoluta de un vector.
static double absoluteNorm(double[] vectorX, double[] vectorY)
          Calcula la norma absoluta de vectorX - vectorY.
static double[] add(double[] vectorX, double[] vectorY)
          Suma dos vectores.
static void clean(double[] vectorX)
          Inicializa a cero el vector.
static boolean copyVector(double[] source, double[] target)
          Asigna los valores de "source" a "target".
static double dotProduct(double[] vectorX, double[] vectorY)
          Deprecated. multiply
static double[] escalarVectorProduct(double escalar, double[] vectorX)
          Deprecated. multiply
static void fill(double[] vectorX, double value)
          Inicializa con el valor todo el vector.
static int indexOfMaxAbs(double[] vectorX)
          Busca el primer elemento mas grande en valor absoluto del vector.
static double infiniteNorm(double[] vectorX)
          Regresa el valor del maximo elemento del vector.
static double multiply(double[] vectorRow, double[] vectorColumn)
          Producto punto (escalar) entre dos vectores.
static double[] multiply(double scalar, double[] vectorX)
          Multiplica un escalar por un vector.
static void print(double[][] matrix)
          Muestra la matriz en la consola.
static void printColumn(double[] vectorCol, java.lang.String message)
          Muestra la matriz de double en la consola.
static void printRow(double[] vectorRow, java.lang.String message)
          Muestra la matriz de double en la consola.
static double rowColumnProduct(double[] vectorRow, double[] vectorColumn)
          Deprecated. multiply
static double[] substract(double[] vectorX, double[] vectorY)
          Al primer vector le resta el segundo.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

VectorPos

public VectorPos()
Method Detail

absoluteNorm

public static double absoluteNorm(double[] vectorX)
                           throws java.lang.NullPointerException
Calcula la norma absoluta de un vector. Llamada "norma euclidiana".

absoluteNorm

public static double absoluteNorm(double[] vectorX,
                                  double[] vectorY)
                           throws java.lang.NullPointerException
Calcula la norma absoluta de vectorX - vectorY.
Returns:
0.0 Si no son del mismo taman~o o se anulan

indexOfMaxAbs

public static int indexOfMaxAbs(double[] vectorX)
                         throws java.lang.NullPointerException
Busca el primer elemento mas grande en valor absoluto del vector. Abreviacion de "firstIndexOfMaximumAbsoluteValue".

infiniteNorm

public static double infiniteNorm(double[] vectorX)
                           throws java.lang.NullPointerException
Regresa el valor del maximo elemento del vector. Notacion: || x ||oo (infinite).

dotProduct

public static double dotProduct(double[] vectorX,
                                double[] vectorY)
                         throws java.lang.NullPointerException
Deprecated. multiply

Equivalente a multiply == dotProduct == rowColumnProduct

rowColumnProduct

public static double rowColumnProduct(double[] vectorRow,
                                      double[] vectorColumn)
                               throws java.lang.NullPointerException
Deprecated. multiply

Equivalente a multiply == dotProduct == rowColumnProduct

escalarVectorProduct

public static double[] escalarVectorProduct(double escalar,
                                            double[] vectorX)
Deprecated. multiply

Equivalente a multiply == escalarVectorProduct

multiply

public static double multiply(double[] vectorRow,
                              double[] vectorColumn)
                       throws java.lang.NullPointerException
Producto punto (escalar) entre dos vectores. Multiplica un vector renglon por uno columna.
Returns:
Escalar con el producto. Si no son del mismo taman~o, 0.0.

multiply

public static double[] multiply(double scalar,
                                double[] vectorX)
                         throws java.lang.NullPointerException
Multiplica un escalar por un vector. "cX".
Returns:
Escalar.

add

public static double[] add(double[] vectorX,
                           double[] vectorY)
                    throws java.lang.NullPointerException
Suma dos vectores.
Returns:
Vector con la suma.

substract

public static double[] substract(double[] vectorX,
                                 double[] vectorY)
                          throws java.lang.NullPointerException
Al primer vector le resta el segundo. v1 - v2
Returns:
Vector con la resta .

clean

public static void clean(double[] vectorX)
                  throws java.lang.NullPointerException
Inicializa a cero el vector.

fill

public static void fill(double[] vectorX,
                        double value)
                 throws java.lang.NullPointerException
Inicializa con el valor todo el vector.

copyVector

public static boolean copyVector(double[] source,
                                 double[] target)
                          throws java.lang.NullPointerException
Asigna los valores de "source" a "target".
Returns:

false. Son de distinto taman~o.

true. Se copiaron.

printColumn

public static void printColumn(double[] vectorCol,
                               java.lang.String message)
                        throws java.lang.NullPointerException
Muestra la matriz de double en la consola.

printRow

public static void printRow(double[] vectorRow,
                            java.lang.String message)
                     throws java.lang.NullPointerException
Muestra la matriz de double en la consola.

print

public static void print(double[][] matrix)
                  throws java.lang.NullPointerException
Muestra la matriz en la consola.