CppAD: A C++ Algorithmic Differentiation Package
20130918
|
00001 /* $Id$ */ 00002 # ifndef CPPAD_SPARSE_PATTERN_INCLUDED 00003 # define CPPAD_SPARSE_PATTERN_INCLUDED 00004 00005 /* -------------------------------------------------------------------------- 00006 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell 00007 00008 CppAD is distributed under multiple licenses. This distribution is under 00009 the terms of the 00010 Eclipse Public License Version 1.0. 00011 00012 A copy of this license is included in the COPYING file of this distribution. 00013 Please visit http://www.coin-or.org/CppAD/ for information on other licenses. 00014 -------------------------------------------------------------------------- */ 00015 00016 // necessary definitions 00017 # include <cppad/local/define.hpp> 00018 # include <cppad/local/sparse_pack.hpp> 00019 # include <cppad/local/sparse_set.hpp> 00020 # include <cppad/local/sparse_list.hpp> 00021 00022 namespace CppAD { // BEGIN_CPPAD_NAMESPACE 00023 /*! 00024 \file sparse_pattern.hpp 00025 Determine internal spasity pattern from correpsonding element type. 00026 */ 00027 00028 /*! 00029 Template structure used obtain the internal sparsity pattern type 00030 form the corresponding element type. 00031 The general form is not valid, must use a specialization. 00032 00033 \tparam Element_type 00034 type of an element in the sparsity structrue. 00035 00036 \par <code>internal_sparsity<Element_type>::pattern_type</code> 00037 is the type of the corresponding internal sparsity pattern. 00038 */ 00039 template <class Element_type> struct internal_sparsity; 00040 /*! 00041 Specilization for \c bool elements. 00042 */ 00043 template <> 00044 struct internal_sparsity<bool> 00045 { 00046 typedef sparse_pack pattern_type; 00047 }; 00048 /*! 00049 Specilization for <code>std::set<size_t></code> elements. 00050 */ 00051 template <> 00052 struct internal_sparsity< std::set<size_t> > 00053 { 00054 typedef CPPAD_INTERNAL_SPARSE_SET pattern_type; 00055 }; 00056 00057 } // END_CPPAD_NAMESPACE 00058 00059 # endif