![]() |
CLA3P v0.3.1
Compact Linear Algebra Parallel Portable Package
|
The general purpose dense vector class. More...

Operators | |
| T_Scalar & | operator() (int_t i) |
| Element access operator. | |
| const T_Scalar & | operator() (int_t i) const |
| Element access operator. | |
Public Member Functions | |
| void | clear () |
| Clear the vector. | |
| void | fill (T_Scalar val) |
| Fill all elements with a value. | |
| XiVector< T_Scalar > | copy () const |
| Create a deep copy of the vector. | |
| XiVector< T_Scalar > | rcopy () |
| Create a reference copy (shallow copy) of the vector. | |
| Guard< XiVector< T_Scalar > > | rcopy () const |
| Create a guarded reference copy (shallow copy) of the vector. | |
| XiVector< T_Scalar > | move () |
| Move the vector's resources. | |
| std::string | info (const std::string &header="") const |
| Get information about the vector. | |
| void | print (std::streamsize prec=0) const |
| Print the vector to standard output. | |
| void | toStream (std::ostream &os, std::streamsize prec=0) const |
| Output the vector to a stream. | |
Creators/Generators | |
| static Guard< XiVector< T_Scalar > > | view (int_t n, const T_Scalar *vals) |
| Create a view of existing memory. | |
Additional Inherited Members | |
| Public Member Functions inherited from cla3p::Meta1D< int_t > | |
| int_t | size () const |
| Vector size. | |
| bool | empty () const |
| Tests whether the object has zero dimension. | |
| operator bool () const | |
| Boolean conversion operator. | |
| Public Member Functions inherited from cla3p::dns::XxContainerBase< T_Scalar > | |
| T_Scalar * | values () |
| Access the data buffer. | |
| const T_Scalar * | values () const |
| Access the data buffer. | |
| Public Member Functions inherited from cla3p::Ownership | |
| Ownership () | |
| Default constructor. | |
| Ownership (bool owner) | |
| Ownership constructor. | |
| ~Ownership () | |
| Destructor. | |
| bool | owner () const |
| Tests memory ownership. | |
| void | unbind () |
| Relinquishes memory ownership. | |
The general purpose dense vector class.
Represents a dense vector stored in contiguous memory.
| T_Scalar | The scalar type (e.g., float, double, complex). |
| T_Scalar & cla3p::dns::XiVector< T_Scalar >::operator() | ( | int_t | i | ) |
Element access operator.
Accesses the element at the specified index.
| [in] | i | The index of the element (0-based). |
| const T_Scalar & cla3p::dns::XiVector< T_Scalar >::operator() | ( | int_t | i | ) | const |
Element access operator.
Accesses the element at the specified index.
| [in] | i | The index of the element (0-based). |
| void cla3p::dns::XiVector< T_Scalar >::clear | ( | ) |
Clear the vector.
Releases all memory and resets the vector to an empty state.
| void cla3p::dns::XiVector< T_Scalar >::fill | ( | T_Scalar | val | ) |
Fill all elements with a value.
Sets all elements in the vector to the specified scalar value.
| [in] | val | The scalar value to fill with. |
| XiVector< T_Scalar > cla3p::dns::XiVector< T_Scalar >::copy | ( | ) | const |
Create a deep copy of the vector.
Creates a new vector with its own memory allocation and copies all elements from this vector to the new vector.
| XiVector< T_Scalar > cla3p::dns::XiVector< T_Scalar >::rcopy | ( | ) |
Create a reference copy (shallow copy) of the vector.
Creates a new vector object that references the same memory as this vector. Changes to either vector will affect both.
| Guard< XiVector< T_Scalar > > cla3p::dns::XiVector< T_Scalar >::rcopy | ( | ) | const |
Create a guarded reference copy (shallow copy) of the vector.
Creates a guarded vector object that references the same memory as this vector. The guard ensures the reference is read-only.
| XiVector< T_Scalar > cla3p::dns::XiVector< T_Scalar >::move | ( | ) |
Move the vector's resources.
Transfers ownership of the memory to a new vector object, leaving this vector in an empty state.
| std::string cla3p::dns::XiVector< T_Scalar >::info | ( | const std::string & | header = "" | ) | const |
Get information about the vector.
Returns a string containing information about the vector's dimensions.
| [in] | header | Optional header string to prepend to the information. |
| void cla3p::dns::XiVector< T_Scalar >::print | ( | std::streamsize | prec = 0 | ) | const |
Print the vector to standard output.
Prints the vector elements to standard output with specified precision.
| [in] | prec | The output precision (default: 0 for default precision). |
| void cla3p::dns::XiVector< T_Scalar >::toStream | ( | std::ostream & | os, |
| std::streamsize | prec = 0 ) const |
Output the vector to a stream.
Writes the vector elements to the specified output stream with specified precision.
| [in,out] | os | The output stream to write to. |
| [in] | prec | The output precision (default: 0 for default precision). |
|
static |
Create a view of existing memory.
Creates a guarded vector that references existing memory without taking ownership. The memory must remain valid for the lifetime of the returned view.
| [in] | n | The number of elements. |
| [in] | vals | Pointer to the memory. |