STK++ 0.9.13
STK_Array2DLowerTriangular.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 Array2DLowerTriangular class.
28 * Author: Serge Iovleff, S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
29 *
30 **/
31
36#ifndef STK_ARRAY2DLOWERTRIANGULAR_H
37#define STK_ARRAY2DLOWERTRIANGULAR_H
38
39#include "STK_IArray2D.h"
40#include "STK_IArray2DSlicers.h"
42
43namespace STK
44{
45// forward declaration
46template<typename> class Array2DLowerTriangular;
47template<typename> class Array2DPoint;
48template<typename> class Array2DVector;
49
60
61namespace hidden
62{
66template<class Type_>
68{ private:
69 class Void {};
70 public:
76 typedef Void SubVector;
77
78 typedef Type_ Type;
79 typedef typename RemoveConst<Type>::Type const& TypeConst;
80
81 enum
82 {
84 orient_ = Arrays::by_col_,
85 sizeRows_ = UnknownSize,
86 sizeCols_ = UnknownSize,
87 storage_ = Arrays::dense_ // always dense
88 };
90};
91
92}
93
107template<class Type_ >
108class Array2DLowerTriangular: public IArray2D< Array2DLowerTriangular<Type_> >
109{
110 public:
114
121
124
125 enum
126 {
131 storage_ = Arrays::dense_ // always dense
132 };
133
140 Array2DLowerTriangular( Range const& I, Range const& J): Base(I, J) {}
147 Array2DLowerTriangular( Range const& I, Range const& J, Type const& v)
148 : Base(I, J)
155 : Base(T, ref) {}
161 Array2DLowerTriangular( const Base& T, Range const& I, Range const& J)
162 : Base(T, I, J) {}
168 Array2DLowerTriangular( Type** q, Range const& I, Range const& J)
169 : Base(q, I, J) {}
173 template<class OtherDerived>
181 template<class Rhs>
195 void shift1D(int beg)
196 { Base::shift(beg, beg);}
201 { Base::resize(I, I); return *this;}
202};
203
204} // namespace STK
205
206#endif
207// STK_ARRAY2DLOWERTRIANGULAR_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...
Declaration of the lower triangular matrix class.
hidden::Traits< Array2DLowerTriangular< Type_ > >::SubArray SubArray
Array2DLowerTriangular & resize1D(Range const &I)
New size for the container.
Array2DLowerTriangular(Range const &I, Range const &J, Type const &v)
constructor with rows_ and rageHo_ specified, initialization with a specified value.
hidden::Traits< Array2DLowerTriangular< Type_ > >::SubCol SubCol
hidden::Traits< Array2DLowerTriangular< Type_ > >::Type Type
Array2DLowerTriangular(const Base &T, Range const &I, Range const &J)
constructor by reference, ref_=1.
hidden::Traits< Array2DLowerTriangular< Type_ > >::SubRow SubRow
hidden::Traits< Array2DLowerTriangular< Type_ > >::TypeConst TypeConst
hidden::Traits< Array2DLowerTriangular< Type_ > >::Col Col
Array2DLowerTriangular(Type **q, Range const &I, Range const &J)
Wrapper constructor Contruct a reference container.
void shift1D(int beg)
New beginning index for the object.
Array2DLowerTriangular & operator=(Type const &v)
operator= : set the container to a constant value.
hidden::Traits< Array2DLowerTriangular< Type_ > >::Row Row
Array2DLowerTriangular & operator=(ExprBase< Rhs > const &T)
operator = : overwrite the CArray with the Right hand side T.
IArray2D< Array2DLowerTriangular< Type_ > > Base
Type for the Interface Class.
Array2DLowerTriangular(const Array2DLowerTriangular &T, bool ref=false)
Copy constructor.
Array2DLowerTriangular(Range const &I, Range const &J)
Constructor with specified ranges.
hidden::Traits< Array2DLowerTriangular< Type_ > >::SubVector SubVector
Array2DLowerTriangular & operator=(Array2DLowerTriangular const &T)
operator = : overwrite the Array2DLowerTriangular with T.
Array2DLowerTriangular(ExprBase< OtherDerived > const &T)
Copy constructor using an expression.
ArrayBase< Array2DLowerTriangular< Type_ > > LowBase
~Array2DLowerTriangular()
destructor : use destructor of IArray2D.
Array2DLowerTriangular< Type_ > & operator=(Type const &value)
Array2DLowerTriangular< Type_ > & setValue(TypeConst value)
set a value to this container.
Array2DLowerTriangular< Type_ > & assign(ExprBase< Rhs > const &rhs)
template interface base class for two-dimensional arrays.
Array2DLowerTriangular< 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...
Index sub-vector region: Specialization when the size is unknown.
Definition STK_Range.h:265
Array2DLowerTriangular< Real > ArrayLowerTriangularXX
Specialization of the Array2D 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.
Array2DLowerTriangular< double > ArrayLowerTriangularXXd
Array2DLowerTriangular< int > ArrayLowerTriangularXXi