/usr/include/clippoly/graphmat++.h is in libclippoly-dev 0.11-6.
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 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | // tutvis library
// Copyright (C) 1993 University of Twente
// klamer@mi.el.utwente.nl
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free
// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef GRAPHMATPLUSPLUS_H
#define GRAPHMATPLUSPLUS_H
// Revision 1.5 2005/02/28 17:21:12 klamer
// Changed to have g++ 3.2.3 run silently using g++ -ansi -pedantic -Wall -Wno-unused -Wno-reorder.
// Change use of (libg++) String to ANSI C++ string.
//
// Revision 1.5 1993/05/13 12:50:59 klamer
// fixed v2 -= v2 to use vv_sub2 instead of vv_add2
// added -v3, v3 * s, s * v3, v3 + v3, v3 -= v3
//
// Revision 1.4 1993/01/18 16:23:47 klamer
// Added m3 * m3, m3 * v3 and v3 - v3.
//
// Revision 1.3 1992/10/20 11:02:52 klamer
// Added operator versions of:
// double * hvec2
// hvec2 / double
// hvec2 += hvec2
// hvec2 -= hvec2
// hvec2 *=double
// hvec2 /= double
//
#ifndef GRAPHMAT_INCLUDE
#include <graphmat.h>
#endif
#ifdef __GNUG__
#pragma interface
#endif
inline hvec2_t
operator-( const hvec2_t &h )
{
hvec2_t ret;
v_fill2(-v_x(h),-v_y(h),v_w(h), &ret);
return ret;
}
inline hvec2_t
operator-( const hvec2_t &l, const hvec2_t &r )
{
hvec2_t ret;
vv_sub2( &l, &r, &ret );
return ret;
}
inline hvec2_t
operator+( const hvec2_t &l, const hvec2_t &r )
{
hvec2_t ret;
vv_add2( &l, &r, &ret );
return ret;
}
inline hvec2_t
operator*( const hmat2_t &m, const hvec2_t &v )
{
hvec2_t ret;
mv_mul2( &m, &v, &ret );
return ret;
}
inline hvec2_t
operator*( double s, const hvec2_t &v )
{
hvec2_t ret;
sv_mul2( s, &v, &ret );
return ret;
}
inline hvec2_t
operator/( const hvec2_t &v, double div )
{
hvec2_t ret;
sv_mul2( 1.0/div, &v, &ret );
return ret;
}
inline hvec2_t const &
operator+=( hvec2_t &v, const hvec2_t &add )
{
vv_add2( &v, &add, &v );
return v;
}
inline hvec2_t const &
operator-=( hvec2_t &v, const hvec2_t &sub )
{
vv_sub2( &v, &sub, &v );
return v;
}
inline hvec2_t const &
operator*=( hvec2_t &v, double mul )
{
sv_mul2( mul, &v, &v );
return v;
}
inline hvec2_t const &
operator/=( hvec2_t &v, double div )
{
sv_mul2( 1.0/div, &v, &v );
return v;
}
inline double
len( const hvec2_t &v )
{
return v_len2( &v );
}
inline hvec3_t
operator-( const hvec3_t &h )
{
hvec3_t ret;
v_fill3(-v_x(h),-v_y(h), -v_z(h), v_w(h), &ret);
return ret;
}
inline hmat3_t
operator*( const hmat3_t &l, const hmat3_t &r )
{
hmat3_t res;
mm_mul3(&l, &r, &res);
return res;
}
inline hvec3_t
operator*( const hmat3_t &m, const hvec3_t &v )
{
hvec3_t res;
mv_mul3(&m, &v, &res);
return res;
}
inline hvec3_t
operator-( const hvec3_t &l, const hvec3_t &r )
{
hvec3_t res;
vv_sub3( &l, &r, &res );
return res;
}
inline hvec3_t
operator*( const hvec3_t &v, double s )
{
hvec3_t ret;
sv_mul3( s, &v, &ret );
return ret;
}
inline hvec3_t
operator*( double s, const hvec3_t &v )
{
hvec3_t ret;
sv_mul3( s, &v, &ret );
return ret;
}
inline hvec3_t
operator+( const hvec3_t &l, const hvec3_t &r )
{
hvec3_t ret;
vv_add3( &l, &r, &ret );
return ret;
}
inline hvec3_t const &
operator-=( hvec3_t &v, const hvec3_t &sub )
{
vv_sub3( &v, &sub, &v );
return v;
}
#endif
|