org.openmali.number.matrix
Class TupleNrad<T extends TupleNrad<T>>

java.lang.Object
  extended by org.openmali.number.matrix.TupleNrad<T>
Direct Known Subclasses:
Tuple3rad

public class TupleNrad<T extends TupleNrad<T>>
extends java.lang.Object


Field Summary
protected  int roTrick
           
protected  Radical1[] values
           
 
Constructor Summary
protected TupleNrad(boolean readOnly, int n)
          Creates a new TupleNf instance.
protected TupleNrad(boolean readOnly, Radical1[] values, int n)
          Creates a new TupleNf instance.
protected TupleNrad(boolean readOnly, Radical1[] values, int n, boolean copy)
          Creates a new TupleNf instance.
protected TupleNrad(boolean readOnly, TupleNrad<?> that)
          Creates a new Tuple3f instance.
  TupleNrad(int n)
          Creates a new TupleNf instance.
  TupleNrad(Radical1[] values, int n)
          Creates a new TupleNf instance.
  TupleNrad(Radical1[] values, int n, boolean copy)
          Creates a new TupleNf instance.
  TupleNrad(TupleNrad<?> that)
          Creates a new Tuple3f instance.
 
Method Summary
 void absolute()
          Sets each component of the tuple parameter to its absolute value and places the modified values into this tuple.
 void absolute(T tuple)
          Sets each component of the tuple parameter to its absolute value and places the modified values into this tuple.
 void add(int i, Radical1 v)
          Adds v to this tuple's i'th value.
 void add(T tuple2)
          Sets the value of this tuple to the vector sum of itself and tuple t1.
 void add(T tuple1, T tuple2)
          Sets the value of this tuple to the vector sum of tuples t1 and t2.
 void div(int i, Radical1 v)
          Divides this tuple's i'th value by v.
 void div(Radical1 v)
          Divides all components of this tuple by v.
 Radical1 dot(Tuple3rad other, Radical1 passback)
           
 boolean equals(java.lang.Object obj)
          
 void fill(Radical1 value)
          Sets all values of this TupleNf to f.
 Radical1 get(int i, Radical1 passback)
          Sets the i-th value of this tuple.
 void get(TupleNrad<?> buffer)
          Writes all values of this Tuple to the specified buffer.
 Radical1 getReference(int index)
           
 int getSize()
           
 int hashCode()
          
 boolean isReadOnly()
           
 void mul(int i, Radical1 v)
          Multiplies v to this tuple's i'th value.
 void mul(Radical1 v)
          Multiplies all components of this tuple with v.
 void negate()
          Negates the value of this vector in place.
 void negate(T tuple)
          Sets the value of this tuple to the negation of tuple that.
 void scale(Rational factor)
          Sets the value of this tuple to the scalar multiplication of itself.
 void scale(Rational factor, T tuple)
          Sets the value of this tuple to the scalar multiplication of tuple t1.
 void set(int i, Radical1 v)
          Sets the i-th value of this tuple.
 void set(Radical1[] values)
          Sets all values of this Tuple to the specified ones.
 void set(TupleNrad<?> tuple)
          Sets all three values of this Tuple to the specified ones.
 void setZero()
          Sets all components to zero.
 void sub(int i, Radical1 v)
          Subtracts v of this tuple's i'th value.
 void sub(T tuple2)
          Sets the value of this tuple to the vector difference of itself and tuple t1 (this = this - t1).
 void sub(T tuple1, T tuple2)
          Sets the value of this tuple to the vector difference of tuple t1 and t2 (this = t1 - t2).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

values

protected final Radical1[] values

roTrick

protected final int roTrick
Constructor Detail

TupleNrad

protected TupleNrad(boolean readOnly,
                    int n)
Creates a new TupleNf instance.

Parameters:
readOnly -
n - the number of elements

TupleNrad

protected TupleNrad(boolean readOnly,
                    Radical1[] values,
                    int n,
                    boolean copy)
Creates a new TupleNf instance.

Parameters:
readOnly -
values - the values array (must be at least size 3)
n - the number of elements
copy - copy the array?

TupleNrad

protected TupleNrad(boolean readOnly,
                    Radical1[] values,
                    int n)
Creates a new TupleNf instance.

Parameters:
readOnly -
values - the values array (must be at least size n)
n - the number of elements to copy

TupleNrad

protected TupleNrad(boolean readOnly,
                    TupleNrad<?> that)
Creates a new Tuple3f instance.

Parameters:
readOnly -
that - the TupleNf to copy the values from

TupleNrad

public TupleNrad(int n)
Creates a new TupleNf instance.

Parameters:
n - the number of elements

TupleNrad

public TupleNrad(Radical1[] values,
                 int n,
                 boolean copy)
Creates a new TupleNf instance.

Parameters:
values - the values array (must be at least size 3)
n - the number of elements
copy - copy the array?

TupleNrad

public TupleNrad(Radical1[] values,
                 int n)
Creates a new TupleNf instance.

Parameters:
values - the values array (must be at least size n)
n - the number of elements to copy

TupleNrad

public TupleNrad(TupleNrad<?> that)
Creates a new Tuple3f instance.

Parameters:
that - the TupleNf to copy the values from
Method Detail

isReadOnly

public final boolean isReadOnly()
Returns:
Is this tuple a read-only one?

getSize

public final int getSize()
Returns:
this Tuple's size().

set

public final void set(int i,
                      Radical1 v)
Sets the i-th value of this tuple.


get

public final Radical1 get(int i,
                          Radical1 passback)
Sets the i-th value of this tuple.


getReference

public final Radical1 getReference(int index)
Parameters:
index -
Returns:
the i'th value of this tuple object reference

fill

public final void fill(Radical1 value)
Sets all values of this TupleNf to f.

Parameters:
value - the value

add

public final void add(int i,
                      Radical1 v)
Adds v to this tuple's i'th value.

Parameters:
i - the index of the value to modify
v - modification amount

sub

public final void sub(int i,
                      Radical1 v)
Subtracts v of this tuple's i'th value.

Parameters:
i - the index of the value to modify
v - modification amount

mul

public final void mul(int i,
                      Radical1 v)
Multiplies v to this tuple's i'th value.

Parameters:
i - the index of the value to modify
v - modification amount

mul

public final void mul(Radical1 v)
Multiplies all components of this tuple with v.

Parameters:
v - modification amount

dot

public Radical1 dot(Tuple3rad other,
                    Radical1 passback)

div

public final void div(int i,
                      Radical1 v)
Divides this tuple's i'th value by v.

Parameters:
i - the index of the value to modify
v - modification amount

div

public final void div(Radical1 v)
Divides all components of this tuple by v.

Parameters:
v - modification amount

set

public void set(Radical1[] values)
Sets all values of this Tuple to the specified ones.

Parameters:
values - the values array (must be at least size getSize())

set

public final void set(TupleNrad<?> tuple)
Sets all three values of this Tuple to the specified ones.

Parameters:
tuple - the tuple to be copied

get

public void get(TupleNrad<?> buffer)
Writes all values of this Tuple to the specified buffer.

Parameters:
buffer - the buffer array to write the values to

setZero

public final void setZero()
Sets all components to zero.


negate

public final void negate()
Negates the value of this vector in place.


negate

public final void negate(T tuple)
Sets the value of this tuple to the negation of tuple that.

Parameters:
tuple - the source vector

absolute

public final void absolute()
Sets each component of the tuple parameter to its absolute value and places the modified values into this tuple.


absolute

public final void absolute(T tuple)
Sets each component of the tuple parameter to its absolute value and places the modified values into this tuple.

Parameters:
tuple - the source tuple, which will not be modified

add

public final void add(T tuple1,
                      T tuple2)
Sets the value of this tuple to the vector sum of tuples t1 and t2.

Parameters:
tuple1 - the first tuple
tuple2 - the second tuple

add

public final void add(T tuple2)
Sets the value of this tuple to the vector sum of itself and tuple t1.

Parameters:
tuple2 - the other tuple

sub

public final void sub(T tuple1,
                      T tuple2)
Sets the value of this tuple to the vector difference of tuple t1 and t2 (this = t1 - t2).

Parameters:
tuple1 - the first tuple
tuple2 - the second tuple

sub

public final void sub(T tuple2)
Sets the value of this tuple to the vector difference of itself and tuple t1 (this = this - t1).

Parameters:
tuple2 - the other tuple

scale

public final void scale(Rational factor,
                        T tuple)
Sets the value of this tuple to the scalar multiplication of tuple t1.

Parameters:
factor - the scalar value
tuple - the source tuple

scale

public final void scale(Rational factor)
Sets the value of this tuple to the scalar multiplication of itself.

Parameters:
factor - the scalar value

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object