/usr/include/polybori/CIdxPath.h is in libpolybori-dev 0.5~rc1-2.1build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | // -*- c++ -*-
//*****************************************************************************
/** @file CIdxPath.h
*
* @author Alexander Dreyer
* @date 2006-12-04
*
* This file contains the definition of a template for the storage type for
* indices.
*
* @par Copyright:
* (c) 2006 by The PolyBoRi Team
*
* @internal
* @version \$Id: CIdxPath.h,v 1.9 2008/07/08 21:41:58 alexanderdreyer Exp $
*
* @par History:
* @verbatim
* $Log: CIdxPath.h,v $
* Revision 1.9 2008/07/08 21:41:58 alexanderdreyer
* Merge: from developer's repository
*
* Revision 1.5 2007/11/06 15:03:34 dreyer
* CHANGE: More generic copyright
*
* Revision 1.4 2006/07/04 14:11:03 dreyer
* ADD: Generic and handy treatment of string literals
*
* Revision 1.3 2006/04/18 07:17:24 dreyer
* FIX bug in CIdxPath using begin() and end() from inherited template
*
* Revision 1.2 2006/04/13 07:53:19 dreyer
* CHANGE BoolePolynomial::print() and deg() produces more useful results
*
* Revision 1.1 2006/04/12 16:23:54 dreyer
* ADD template class CIDXPath<>
*
* @endverbatim
**/
//*****************************************************************************
// get std::vector functionality
#include <vector>
// get std::iterator functionality
#include <iterator>
// include basic definitions
#include "pbori_defs.h"
// get functionals and algorithms
#include "pbori_func.h"
#include "pbori_algo.h"
#include "CStringLiteral.h"
#include "CPrintOperation.h"
#include "CIdxVariable.h"
#ifndef CIdxPath_h_
#define CIdxPath_h_
/** @class CIdxPath
* @brief This template class defines a storage type for monomial indices
* and customizable "pretty" printing.
**/
BEGIN_NAMESPACE_PBORI
template <class IdxType = CIdxVariable<CTypes::idx_type>,
class SeparatorType = CStringLiteral<CLiteralCodes::list_separator> >
class CIdxPath:
public std::vector<IdxType> {
public:
/// @name Adopt global type definitions
//@{
typedef IdxType idx_type;
typedef CTypes::ostream_type ostream_type;
//@}
/// Type of base class
typedef std::vector<idx_type> base;
/// Type used to generate a string for separating elements
typedef SeparatorType separator_type;
/// String-like type for separator
// typedef typename separator_type::result_type sep_value_type ;
/// Type of *this
typedef CIdxPath<idx_type, separator_type> self;
/// Type for sizes
typedef typename base::size_type size_type;
/// Default constructor
CIdxPath(): base() {}
/// Construct storage for nlen indices
CIdxPath(size_type nlen): base(nlen) {};
/// Copy constructor
CIdxPath(const self& rhs): base(rhs) {};
/// Destructor
~CIdxPath() {};
/// Print to out-stream
ostream_type& print(ostream_type& os) const {
if (base::begin() == base::end()) {
os << 1;
}
special_first_transform( base::begin(), base::end(),
std::ostream_iterator<idx_type>(os),
CPrintOperation<idx_type, separator_type>(os),
project_ith<1>() );
return os;
}
};
/// Stream output operator
template <class IdxType, class SeparatorType>
inline typename CIdxPath<IdxType, SeparatorType>::ostream_type&
operator<<(typename CIdxPath<IdxType, SeparatorType>::ostream_type& os,
const CIdxPath<IdxType, SeparatorType>& storage){
return storage.print(os);
}
END_NAMESPACE_PBORI
#endif
|