All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Typedefs
CompressedMatrix.h File Reference

Implementation of a compressed MxN matrix. More...

#include <algorithm>
#include <functional>
#include <stdexcept>
#include <vector>
#include <blaze/math/expressions/SparseMatrix.h>
#include <blaze/math/Forward.h>
#include <blaze/math/Functions.h>
#include <blaze/math/shims/Equal.h>
#include <blaze/math/shims/IsDefault.h>
#include <blaze/math/sparse/MatrixAccessProxy.h>
#include <blaze/math/sparse/ValueIndexPair.h>
#include <blaze/math/traits/AddTrait.h>
#include <blaze/math/traits/ColumnTrait.h>
#include <blaze/math/traits/DivTrait.h>
#include <blaze/math/traits/MathTrait.h>
#include <blaze/math/traits/MultTrait.h>
#include <blaze/math/traits/RowTrait.h>
#include <blaze/math/traits/SubmatrixTrait.h>
#include <blaze/math/traits/SubTrait.h>
#include <blaze/math/typetraits/IsResizable.h>
#include <blaze/math/typetraits/IsSparseMatrix.h>
#include <blaze/system/Precision.h>
#include <blaze/system/StorageOrder.h>
#include <blaze/util/Assert.h>
#include <blaze/util/constraints/Const.h>
#include <blaze/util/constraints/Numeric.h>
#include <blaze/util/constraints/Pointer.h>
#include <blaze/util/constraints/Reference.h>
#include <blaze/util/constraints/SameSize.h>
#include <blaze/util/constraints/Volatile.h>
#include <blaze/util/EnableIf.h>
#include <blaze/util/mpl/If.h>
#include <blaze/util/Null.h>
#include <blaze/util/Types.h>
#include <blaze/util/typetraits/IsFloatingPoint.h>
#include <blaze/util/typetraits/IsNumeric.h>

Go to the source code of this file.

Classes

class  blaze::CompressedMatrix< Type, SO >
 Efficient implementation of a $ M \times N $ compressed matrix.The CompressedMatrix class template is the representation of an arbitrary sized sparse matrix with $ M \cdot N $ dynamically allocated elements of arbitrary type. The type of the elements and the storage order of the matrix can be specified via the two template parameters: More...
 

Namespaces

 blaze
 Namespace of the Blaze C++ math library.
 

Typedefs

typedef CompressedMatrix< Type,
true > 
blaze::This
 Type of this CompressedMatrix instance.
 
typedef This blaze::ResultType
 Result type for expression template evaluations.
 
typedef CompressedMatrix< Type,
false > 
blaze::OppositeType
 Result type with opposite storage order for expression template evaluations.
 
typedef CompressedMatrix< Type,
false > 
blaze::TransposeType
 Transpose type for expression template evaluations.
 
typedef Type blaze::ElementType
 Type of the sparse matrix elements.
 
typedef const Type & blaze::ReturnType
 Return type for expression template evaluations.
 
typedef const This & blaze::CompositeType
 Data type for composite expression templates.
 
typedef MatrixAccessProxy< This > blaze::Reference
 Reference to a non-constant matrix value.
 
typedef const Type & blaze::ConstReference
 Reference to a constant matrix value.
 
typedef Element * blaze::Iterator
 Iterator over non-constant elements.
 
typedef const Element * blaze::ConstIterator
 Iterator over constant elements.
 

Functions

Constructors
 blaze::CompressedMatrix ()
 
 blaze::CompressedMatrix (size_t m, size_t n)
 
 blaze::CompressedMatrix (size_t m, size_t n, size_t nonzeros)
 
 blaze::CompressedMatrix (size_t m, size_t n, const std::vector< size_t > &nonzeros)
 
 blaze::CompressedMatrix (const CompressedMatrix &sm)
 
template<typename MT , bool SO>
 blaze::CompressedMatrix (const DenseMatrix< MT, SO > &dm)
 
template<typename MT , bool SO>
 blaze::CompressedMatrix (const SparseMatrix< MT, SO > &sm)
 
Destructor
 blaze::~CompressedMatrix ()
 
Data access functions
Reference blaze::operator() (size_t i, size_t j)
 
Iterator blaze::begin (size_t i)
 
ConstIterator blaze::cbegin (size_t i) const
 
Iterator blaze::end (size_t i)
 
ConstIterator blaze::cend (size_t i) const
 
Assignment operators
CompressedMatrix & blaze::operator= (const CompressedMatrix &rhs)
 
template<typename MT , bool SO>
CompressedMatrix & blaze::operator= (const DenseMatrix< MT, SO > &rhs)
 
template<typename MT , bool SO>
CompressedMatrix & blaze::operator= (const SparseMatrix< MT, SO > &rhs)
 
template<typename MT , bool SO>
CompressedMatrix & blaze::operator+= (const Matrix< MT, SO > &rhs)
 
template<typename MT , bool SO>
CompressedMatrix & blaze::operator-= (const Matrix< MT, SO > &rhs)
 
template<typename MT , bool SO>
CompressedMatrix & blaze::operator*= (const Matrix< MT, SO > &rhs)
 
template<typename Other >
EnableIf< IsNumeric< Other >
, CompressedMatrix >::Type & 
blaze::operator*= (Other rhs)
 
template<typename Other >
EnableIf< IsNumeric< Other >
, CompressedMatrix >::Type & 
blaze::operator/= (Other rhs)
 
Utility functions
size_t blaze::rows () const
 
size_t blaze::columns () const
 
size_t blaze::capacity () const
 
size_t blaze::capacity (size_t j) const
 
size_t blaze::nonZeros () const
 
size_t blaze::nonZeros (size_t j) const
 
void blaze::reset ()
 
void blaze::reset (size_t j)
 
void blaze::clear ()
 
Iterator blaze::insert (size_t i, size_t j, const Type &value)
 
void blaze::erase (size_t i, size_t j)
 
Iterator blaze::erase (size_t j, Iterator pos)
 
Iterator blaze::erase (size_t j, Iterator first, Iterator last)
 
void blaze::resize (size_t m, size_t n, bool preserve=true)
 
void blaze::reserve (size_t nonzeros)
 
void blaze::reserve (size_t j, size_t nonzeros)
 
void blaze::trim ()
 
void blaze::trim (size_t j)
 
CompressedMatrix & blaze::transpose ()
 
template<typename Other >
CompressedMatrix & blaze::scale (Other scalar)
 
template<typename Other >
CompressedMatrix & blaze::scaleDiagonal (Other scalar)
 
void blaze::swap (CompressedMatrix &sm)
 
size_t blaze::extendCapacity () const
 
void blaze::reserveElements (size_t nonzeros)
 
Lookup functions
Iterator blaze::find (size_t i, size_t j)
 
Iterator blaze::lowerBound (size_t i, size_t j)
 
Iterator blaze::upperBound (size_t i, size_t j)
 
Low-level utility functions
void blaze::append (size_t i, size_t j, const Type &value, bool check=false)
 
void blaze::finalize (size_t j)
 
Expression template evaluation functions
template<typename Other >
bool blaze::canAlias (const Other *alias) const
 
template<typename Other >
bool blaze::isAliased (const Other *alias) const
 
template<typename MT , bool SO>
void blaze::assign (const DenseMatrix< MT, SO > &rhs)
 
template<typename MT >
void blaze::assign (const SparseMatrix< MT, true > &rhs)
 
template<typename MT >
void blaze::assign (const SparseMatrix< MT, false > &rhs)
 
template<typename MT , bool SO>
void blaze::addAssign (const DenseMatrix< MT, SO > &rhs)
 
template<typename MT , bool SO>
void blaze::addAssign (const SparseMatrix< MT, SO > &rhs)
 
template<typename MT , bool SO>
void blaze::subAssign (const DenseMatrix< MT, SO > &rhs)
 
template<typename MT , bool SO>
void blaze::subAssign (const SparseMatrix< MT, SO > &rhs)
 
CompressedMatrix operators
template<typename Type , bool SO>
void reset (CompressedMatrix< Type, SO > &m)
 Resetting the given sparse matrix. More...
 
template<typename Type , bool SO>
void clear (CompressedMatrix< Type, SO > &m)
 Clearing the given sparse matrix. More...
 
template<typename Type , bool SO>
bool isDefault (const CompressedMatrix< Type, SO > &m)
 Returns whether the given sparse matrix is in default state. More...
 
template<typename Type , bool SO>
void swap (CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b)
 Swapping the contents of two sparse matrices. More...
 

Variables

Member variables
size_t blaze::m_
 The current number of rows of the sparse matrix. More...
 
size_t blaze::n_
 The current number of columns of the sparse matrix. More...
 
size_t blaze::capacity_
 The current capacity of the pointer array.
 
Iteratorblaze::begin_
 Pointers to the first non-zero element of each column.
 
Iteratorblaze::end_
 Pointers one past the last non-zero element of each column.
 
static const Type blaze::zero_
 Neutral element for accesses to zero elements.
 

Detailed Description

Implementation of a compressed MxN matrix.

Copyright (C) 2013 Klaus Iglberger - All Rights Reserved

This file is part of the Blaze library. You can redistribute it and/or modify it under the terms of the New (Revised) BSD License. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the names of the Blaze development group nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.