35#ifndef STK_ISPARSEARRAY1D_H
36#define STK_ISPARSEARRAY1D_H
55template<
class Derived>
111 template<
class OtherDerived>
120 template<
class OtherDerived>
128 inline bool isRef()
const {
return allocator_.isRef();}
134 inline void setRef(
bool ref)
const { allocator_.setRef(ref);}
139 Allocator
const&
allocator()
const {
return allocator_;}
In this file we define and implement the MemSAllocator class.
Interface class for SparseArray1D.
ISparseArray1D(ExprBase< OtherDerived > const &T)
Copy constructor.
ISparseArray1D(ISparseArray1D< OtherDerived > const &T, Range const &I)
constructor by reference, ref_=1.
void clear()
Clear the object.
Allocator const & allocator() const
void exchange(ISparseArray1D &T)
exchange this Container with T.
hidden::Traits< Derived >::Type Type
Derived & push_back(Type const &v)
STL compatibility: append an element v.
ISparseArray1D(const ISparseArray1D &T, bool ref=false)
Copy constructor.
hidden::Traits< Derived >::Col Col
Derived & pushBack(int n=1)
Add n Elements to the end of the container.
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
Derived & resizeImpl(Range const &I)
Resize the container.
hidden::Traits< Derived >::SubArray SubArray
ISparseArray1D(Range const &I)
constructor with a specified Range.
ITContainer1D< Derived > Base
void reserve(int size)
reserve internal memory for at least size elements.
void move(Derived const &T)
move T to this.
Derived & popBack(int n=1)
Delete last elts of the container.
ISparseArray1D()
Default constructor.
Derived & insert(Range const &I, Type const &v)
STL compatibility: Insert element v in the range I of the Array.
ISparseArray1D(Range const &I, Type const &v)
Misc constructor with first and last, initialization with a constant.
RowRange const & rows() const
Derived & erase(int pos, int n=1)
Delete n elements at the pos index to the container.
~ISparseArray1D()
destructor: allocated memory is liberated by MemAllocator base class.
Type & elt1Impl(int pos)
access to an element
Derived & setValue(Type const &value)
set a value to this container.
Derived & push_front(Type const &v)
STL compatibility: push front an element.
void setRef(bool ref) const
Modify the state of the container: this become a reference (if ref is true) or the owner of the data ...
hidden::CheckShift< Derived, structure_ > CheckShift
void swap(int pos1, int pos2)
Swapping the pos1 elt and the pos2 elt.
RowRange const & range() const
Derived & insertElt(int pos, int n=1)
Insert n elements at the position pos of the container.
Derived & assign(ISparseArray1D const &src)
overwrite this with src.
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
Derived & insert(int pos, Type const &v)
STL compatibility: Insert element v at position pos of the Array.
void shiftImpl(int beg=baseIdx)
New beginning index for the object.
TypeConst elt1Impl(int pos) const
access to a constant element
ISparseArray1D(ISparseArray1D const &T, Range const &I)
constructor by reference, ref_=1.
Interface base class for homogeneous 1D containers.
void setRange(RowRange const &I=RowRange())
Set range of the rows of the container.
hidden::Traits< Derived >::TypeConst TypeConst
RowRange const & range() const
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Index sub-vector region: Specialization when the size is unknown.
const int baseIdx
base index of the containers created in STK++.
The namespace STK is the main domain space of the Statistical ToolKit project.
Utility class allowing to know if in an assignment the destination must be resized or shifted.