libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CRNMatrixDouble.h
Go to the documentation of this file.
1 /* Copyright 2007-2016 Yann LEYDIER, CoReNum, INSA-Lyon, ENS-Lyon
2  *
3  * This file is part of libcrn.
4  *
5  * libcrn is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * libcrn is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with libcrn. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * file: CRNMatrixDouble.h
19  * \author Jean DUONG, Yann LEYDIER
20  */
21 
22 #ifndef CRNMATRIXDOUBLE_HEADER
23 #define CRNMATRIXDOUBLE_HEADER
24 
25 #include <CRNMath/CRNMatrix.h>
27 #include <CRNMath/CRNMath.h>
28 
29 namespace crn
30 {
31  class SquareMatrixDouble;
32 
42  class MatrixDouble: public Matrix<double>
43  {
44  public:
47  MatrixDouble(Matrix<double> &&m) : Matrix(std::move(m)) {}
48 
51 
52  MatrixDouble(const MatrixDouble &) = default;
53  MatrixDouble(MatrixDouble &&) = default;
54 
55  MatrixDouble& operator=(const MatrixDouble &) = default;
56  MatrixDouble& operator=(MatrixDouble &&) = default;
57 
59  virtual ~MatrixDouble() override = default;
60 
62  double CumulateSquaredCells() const;
63 
65  static MatrixDouble NewGaussianLine(double sigma);
67  static MatrixDouble NewGaussianLineDerivative(double sigma);
69  static MatrixDouble NewGaussianLineSecondDerivative(double sigma);
72 
73  virtual void Deserialize(xml::Element &el);
74  virtual xml::Element Serialize(xml::Element &parent) const;
75 
76  protected:
78  private:
79  virtual std::string getClassName() const { return "MatrixDouble"; }
80  };
81  template<> struct IsSerializable<MatrixDouble> : public std::true_type {};
82  template<> struct IsClonable<MatrixDouble> : public std::true_type {};
83 
84  template<> struct TypeInfo<MatrixDouble>
85  {
89  };
90 
91 
92 }
93 
94 #endif
static MatrixDouble NewGaussianLineDerivative(double sigma)
Creates a line matrix with the derivative of a centered Gaussian.
XML element.
Definition: CRNXml.h:135
double CumulateSquaredCells() const
Computes the sum of the squared elements.
MatrixDouble(const Matrix< double > &m)
static MatrixDouble NewGaussianLineSecondDerivative(double sigma)
Creates a line matrix with the second derivative of a centered Gaussian.
static MatrixDouble NewGaussianLine(double sigma)
Creates a line matrix with a centered Gaussian.
MatrixDouble(xml::Element &el)
Defines a default constructor from xml element.
virtual xml::Element Serialize(xml::Element &parent) const
MatrixDouble & operator=(const MatrixDouble &)=default
Base matrix class.
Definition: CRNMatrix.h:43
virtual void Deserialize(xml::Element &el)
double matrix class
virtual ~MatrixDouble() override=default
Destructor.
#define CRN_DECLARE_CLASS_CONSTRUCTOR(classname)
Declares a class constructor.
Definition: CRNObject.h:173
Square double matrix class.
MatrixDouble(Matrix< double > &&m)
A class containing informations on a type.
Definition: CRNType.h:176
SquareMatrixDouble MakeVectorRightAutoProduct() const
Get the product of a column vector by its own transposed on the right side.