All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fill.hpp
Go to the documentation of this file.
#ifndef VIENNACL_TRAITS_FILL_HPP_
#define VIENNACL_TRAITS_FILL_HPP_
/* =========================================================================
Copyright (c) 2010-2016, Institute for Microelectronics,
Institute for Analysis and Scientific Computing,
TU Wien.
Portions of this software are copyright by UChicago Argonne, LLC.
-----------------
ViennaCL - The Vienna Computing Library
-----------------
Project Head: Karl Rupp rupp@iue.tuwien.ac.at
(A list of authors and contributors can be found in the manual)
License: MIT (X11), see file LICENSE in the base directory
============================================================================= */
#include <string>
#include <fstream>
#include <sstream>
#include "viennacl/forwards.h"
#include "viennacl/meta/result_of.hpp"
#ifdef VIENNACL_WITH_EIGEN
#include <Eigen/Core>
#include <Eigen/Sparse>
#endif
#include <vector>
#include <map>
namespace viennacl
{
namespace traits
{
template<typename MatrixType, typename NumericT>
void fill(MatrixType & matrix, vcl_size_t row_index, vcl_size_t col_index, NumericT value)
{
matrix(row_index, col_index) = value;
}
#ifdef VIENNACL_WITH_EIGEN
template<typename T, int options, typename NumericT>
inline void fill(Eigen::SparseMatrix<T, options> & m,
vcl_size_t row_index,
vcl_size_t col_index,
NumericT value
)
{
m.insert(row_index, col_index) = value;
}
#endif
} //namespace traits
} //namespace viennacl
#endif
viennacl::traits::fill
void fill(MatrixType &matrix, vcl_size_t row_index, vcl_size_t col_index, NumericT value)
Generic filler routine for setting an entry of a matrix to a particular value.
Definition: fill.hpp:46
forwards.h
This file provides the forward declarations for the main types used within ViennaCL.
viennacl::matrix
A dense matrix class.
Definition: forwards.h:375
NumericT
float NumericT
Definition: bisect.cpp:40
viennacl::vcl_size_t
std::size_t vcl_size_t
Definition: forwards.h:75
result_of.hpp
A collection of compile time type deductions.