STK++ 0.9.13
STK_SArray2DLowerTriangular.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------*/
2/* Copyright (C) 2004-2016 Serge Iovleff, Université Lille 1, Inria
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to the
16 Free Software Foundation, Inc.,
17 59 Temple Place,
18 Suite 330,
19 Boston, MA 02111-1307
20 USA
21
22 Contact : S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
23*/
24
25/*
26 * Project: stkpp::Arrays
27 * Purpose: Define the SArray2DLowerTriangular class.
28 * Author: Serge Iovleff, S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
29 *
30 **/
31
36#ifndef STK_SARRAY2DLOWERTRIANGULAR_H
37#define STK_SARRAY2DLOWERTRIANGULAR_H
38
39#include "STK_SArray1D.h"
40
41#include "STK_IArray2D.h"
42#include "STK_IArray2DSlicers.h"
44
45namespace STK
46{
47// forward declaration
48template<typename> class SArray2DLowerTriangular;
49template<typename> class SArray2DPoint;
50template<typename> class SArray2DVector;
51
62
63namespace hidden
64{
68template<class Type_>
70{ private:
71 class Void {};
72 public:
78 typedef Void SubVector;
79
80 typedef Type_ Type;
81 typedef typename RemoveConst<Type>::Type const& TypeConst;
82
83 enum
84 {
86 orient_ = Arrays::by_col_,
87 sizeRows_ = UnknownSize,
88 sizeCols_ = UnknownSize,
89 storage_ = Arrays::dense_
90 };
92};
93
94}
95
109template<class Type_ >
110class SArray2DLowerTriangular: public IArray2D< SArray2DLowerTriangular<Type_> >
111{
112 public:
116
123
126
127 enum
128 {
133 storage_ = Arrays::dense_ // always dense
134 };
135
142 SArray2DLowerTriangular( Range const& I, Range const& J): Base(I, J) {}
149 SArray2DLowerTriangular( Range const& I, Range const& J, Type const& v)
150 : Base(I, J)
157 : Base(T, ref) {}
163 SArray2DLowerTriangular( const Base& T, Range const& I, Range const& J)
164 : Base(T, I, J) {}
171 : Base(q, I, J) {}
175 template<class OtherDerived>
183 template<class Rhs>
197 void shift1D(int beg)
198 { Base::shift(beg, beg);}
203 { Base::resize(I, I); return *this;}
204};
205
206} // namespace STK
207
208#endif
209// STK_SARRAY2DLOWERTRIANGULAR_H
In this file we implement the modifiers of the IArray2D.
In this file we implement the slicing methods for IArray2D class.
Interface base class for the Array2D classes, this is an internal header file, included by other cont...
In this file we define and implement the final class SArray1D.
SArray2DLowerTriangular< Type_ > & operator=(Type const &value)
SArray2DLowerTriangular< Type_ > & setValue(TypeConst value)
set a value to this container.
SArray2DLowerTriangular< Type_ > & assign(ExprBase< Rhs > const &rhs)
template interface base class for two-dimensional arrays.
SArray2DLowerTriangular< Type_ > & resize(Range const &I, Range const &J)
resize the array.
void shift(int rbeg, int cbeg)
Set new beginning indexes to the array.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Declaration of the lower triangular matrix class.
hidden::Traits< SArray2DLowerTriangular< Type_ > >::SubCol SubCol
SArray2DLowerTriangular(Range const &I, Range const &J, Type const &v)
constructor with rows_ and rageHo_ specified, initialization with a specified value.
IArray2D< SArray2DLowerTriangular< Type_ > > Base
Type for the Interface Class.
SArray2DLowerTriangular(Type **q, Range const &I, Range const &J)
Wrapper constructor Contruct a reference container.
SArray2DLowerTriangular(Range const &I, Range const &J)
Constructor with specified ranges.
SArray2DLowerTriangular & operator=(SArray2DLowerTriangular const &T)
operator = : overwrite the SArray2DLowerTriangular with T.
SArray2DLowerTriangular(const SArray2DLowerTriangular &T, bool ref=false)
Copy constructor.
~SArray2DLowerTriangular()
destructor : use destructor of IArray2D.
void shift1D(int beg)
New beginning index for the object.
SArray2DLowerTriangular & operator=(Type const &v)
operator= : set the container to a constant value.
hidden::Traits< SArray2DLowerTriangular< Type_ > >::TypeConst TypeConst
hidden::Traits< SArray2DLowerTriangular< Type_ > >::Type Type
SArray2DLowerTriangular & resize1D(Range const &I)
New size for the container.
hidden::Traits< SArray2DLowerTriangular< Type_ > >::Row Row
hidden::Traits< SArray2DLowerTriangular< Type_ > >::SubArray SubArray
SArray2DLowerTriangular(const Base &T, Range const &I, Range const &J)
constructor by reference, ref_=1.
SArray2DLowerTriangular(ExprBase< OtherDerived > const &T)
Copy constructor using an expression.
hidden::Traits< SArray2DLowerTriangular< Type_ > >::SubRow SubRow
SArray2DLowerTriangular & operator=(ExprBase< Rhs > const &T)
operator = : overwrite the CArray with the Right hand side T.
hidden::Traits< SArray2DLowerTriangular< Type_ > >::Col Col
ArrayBase< SArray2DLowerTriangular< Type_ > > LowBase
hidden::Traits< SArray2DLowerTriangular< Type_ > >::SubVector SubVector
Index sub-vector region: Specialization when the size is unknown.
Definition STK_Range.h:265
SArray2DLowerTriangular< Real > SArrayLowerTriangularXX
Specialization of the SArray2D class for lower triangular matrices.
@ dense_
dense matrix/vector/array/expression
@ lower_triangular_
lower triangular matrix/array/expression
@ by_col_
storage by column
const int UnknownSize
This value means that an integer is not known at compile-time, and that instead the value is stored i...
The namespace STK is the main domain space of the Statistical ToolKit project.
SArray2DLowerTriangular< double > SArrayLowerTriangularXXd
SArray2DLowerTriangular< int > SArrayLowerTriangularXXi