#include <lavli.h>
Inheritance diagram for LaVectorLongInt:
Declaration | |
LaVectorLongInt () | |
LaVectorLongInt (int n) | |
LaVectorLongInt (int m, int n) | |
LaVectorLongInt (long int *v, int n) | |
LaVectorLongInt (long int *v, int m, int n) | |
LaVectorLongInt (const LaGenMatLongInt &) | |
LaVectorLongInt (const LaIndex &ind) | |
Information | |
int | size () const |
int | inc () const |
int | start () const |
int | end () const |
LaIndex | index () const |
Access functions | |
long int & | operator() (int i) |
const long int & | operator() (int i) const |
LaVectorLongInt | operator() (const LaIndex &) |
Assignments | |
LaVectorLongInt & | operator= (long int) |
LaVectorLongInt & | operator= (const LaGenMatLongInt &) |
LaVectorLongInt & | inject (const LaGenMatLongInt &) |
LaVectorLongInt & | copy (const LaGenMatLongInt &) |
LaVectorLongInt & | ref (const LaGenMatLongInt &) |
A vector is simply an nx1 or 1xn, matrix, only that it can be constructed and accessed by a single dimension.
LaVectorLongInt::LaVectorLongInt | ( | ) | [inline] |
Constructs a column vector of length 0 (null).
LaVectorLongInt::LaVectorLongInt | ( | int | n | ) | [inline] |
Constructs a column vector of length n
LaVectorLongInt::LaVectorLongInt | ( | int | m, | |
int | n | |||
) | [inline] |
Constructs a vector of size . One of the two dimensions must be one!
LaVectorLongInt::LaVectorLongInt | ( | long int * | v, | |
int | n | |||
) | [inline] |
Constructs a column vector of length n by copying the values from a one-dimensional C array of length n.
LaVectorLongInt::LaVectorLongInt | ( | long int * | v, | |
int | m, | |||
int | n | |||
) | [inline] |
Constructs an vector by copying the values from a one-dimensional C array of length mn. One of the two dimensions must be one!
LaVectorLongInt::LaVectorLongInt | ( | const LaGenMatLongInt & | ) | [inline] |
Create a new vector from an existing matrix by copying. The given matrix s must be a vector, i.e. one of its dimensions must be one!
LaVectorLongInt::LaVectorLongInt | ( | const LaIndex & | ind | ) |
Create this integer vector from the index counting of this LaIndex() object.
int LaVectorLongInt::size | ( | ) | const [inline] |
Returns the length n of this vector.
int LaVectorLongInt::inc | ( | ) | const [inline] |
Returns the distance between memory locations (in terms of number of elements) between consecutive elements along dimension d. For example, if inc(d)
returns 1, then elements along the dth dimension are contiguous in memory.
int LaVectorLongInt::start | ( | ) | const [inline] |
If the memory space used by this matrix is viewed as a linear array, start(d)
returns the starting offset of the first element in dimension d
. (See LaIndex class.)
int LaVectorLongInt::end | ( | ) | const [inline] |
If the memory space used by this matrix is viewed as a linear array, end(d)
returns the starting offset of the last element in dimension d
. (See LaIndex class.)
LaIndex LaVectorLongInt::index | ( | ) | const [inline] |
Returns the index specifying this submatrix view in dimension d
. (See LaIndex class.) This will only differ from a unit-stride index is the current matrix is actually a submatrix view of some larger matrix.
long int & LaVectorLongInt::operator() | ( | int | i | ) | [inline] |
Returns the th element of this vector, with the index i starting at zero (zero-based offset). This means you have
but for accessing the element you have to write v(0)
.
Optional runtime bounds checking (0<=i<=n) is set by the compile time macro LA_BOUNDS_CHECK.
const long int & LaVectorLongInt::operator() | ( | int | i | ) | const [inline] |
Returns the th element of this vector, with the index i starting at zero (zero-based offset). This means you have
but for accessing the element you have to write v(0)
.
Optional runtime bounds checking (0<=i<=n) is set by the compile time macro LA_BOUNDS_CHECK.
LaVectorLongInt LaVectorLongInt::operator() | ( | const LaIndex & | ) | [inline] |
Return a submatrix view specified by the index I. (See LaIndex class.) These indices specify start, increment, and ending offsets, similar to triplet notation of Matlab or Fortran 90. For example, if B is a 10 x 10 matrix, I is (0:2:2) and J is
(3:1:4), then
B(I,J)
denotes the 2 x 2 matrix
LaVectorLongInt & LaVectorLongInt::operator= | ( | long | int | ) | [inline] |
Set elements of left-hand size to the scalar value s. No new vector is created, so that if there are other vectors that reference this memory space, they will also be affected.
Reimplemented from LaGenMatLongInt.
LaVectorLongInt & LaVectorLongInt::operator= | ( | const LaGenMatLongInt & | ) | [inline] |
Release left-hand side (reclaiming memory space if possible) and copy elements of elements of s
. Unline inject()
, it does not require conformity, and previous references of left-hand side are unaffected.
This is an alias for copy().
Reimplemented from LaGenMatLongInt.
LaVectorLongInt & LaVectorLongInt::inject | ( | const LaGenMatLongInt & | ) | [inline] |
Copy elements of s into the memory space referenced by the left-hand side, without first releasing it. The effect is that if other vectors share memory with left-hand side, they too will be affected. Note that the size of s must be the same as that of the left-hand side vector.
s
, you should use copy()
instead. Reimplemented from LaGenMatLongInt.
LaVectorLongInt & LaVectorLongInt::copy | ( | const LaGenMatLongInt & | ) | [inline] |
Release left-hand side (reclaiming memory space if possible) and copy elements of elements of s
. Unline inject()
, it does not require conformity, and previous references of left-hand side are unaffected.
Reimplemented from LaGenMatLongInt.
LaVectorLongInt & LaVectorLongInt::ref | ( | const LaGenMatLongInt & | ) | [inline] |
Let this vector reference the given vector s, so that the given vector memory s is now referenced by multiple objects (by the given object s and now also by this object). Handle this with care!
This function releases any previously referenced memory of this object.
Reimplemented from LaGenMatLongInt.