This file is indexed.

/usr/include/miaviewit-1.0/viewit/4DVector.hh is in libmiaviewit-dev 1.0.1-1.

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
231
232
233
234
235
236
237
238
239
240
/* -*- mia-c++ -*-
 *
 * This file is part of viewitgui - a library and program for the
 * visualization of 3D data sets. 
 *
 * Copyright (c) Leipzig, Madrid 1999-2013 Mirco Hellmann, Gert Wollny
 *
 * viewitgui is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * viewitgui 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with viewitgui; if not, see <http://www.gnu.org/licenses/>.
 */


#ifndef __MONA_4DVECTOR_HH
#define __MONA_4DVECTOR_HH 1

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <typeinfo>
#include <assert.h>
#include <stdexcept>
#include <math.h>
#include <iostream>
#include <cstring>
#include <cstdio>

namespace mia {
#define g_vector_start '<'
#define g_vector_end '>'

	template < class T > class T4DVector {
	public:
		T x,y,z,a;
		
		T4DVector():x(0),y(0),z(0),a(0){};
		T4DVector(int dim):x(0),y(0),z(0),a(0){
			assert(dim == 4);
		}
		
		T4DVector(const T& _x,const T& _y,const T& _z, const T& _a):
			x(_x),y(_y),z(_z),a(_a){
			}
		template <class in> T4DVector(const T4DVector<in>& org):
			x(T(org.x)),y(T(org.y)),z(T(org.z)),a(T(org.a)){
			}
		T operator[](int i)const {
			// Cruel hack, i have to think of something better
			return (&x)[i];
		}
		T& operator[](int i) {
			// dito
			return (&x)[i];
		}
		template <class in> T4DVector<T>& operator =(const T4DVector<in>& org){
			if (this != &org) {
				x=org.x; y=org.y; z=org.z, a=org.a;
			}
			return *this;
		}
		
		double norm()const{
			return sqrt( x*x+ y*y+ z*z+ a*a);
		}
		double norm2()const{
			return x*x + y*y + z*z + a*a;
		}
		
		double norm_inf() const{
			const char *help= typeid(T).name();
			double result; 
			if (strchr("csldfirx",help[0])!=0) {
				result = fabs(x);
				double b = fabs(y);
				if (b > result) result = b;
				b = fabs(z);
				if (b > result) result = b;
				b = fabs(a);
				if (b > result) result = b;
			}else if (help[0] == 'U') { // unsigned type
				result = ( x > y ?  ( x > z ? x : z ) : ( y > z ? y : z ));
				result = a > result ? a : result;
			}else{
				fprintf(stderr,"error type infnorm\n");
			}
			// if elemt type is pointer or class , instanciation will fail anyway
			// since no fabs is defined
			return result;
		}
		int get_dim() const {
			return 4;
		}
		
		T4DVector<T>& operator +=(const T4DVector<T>& u){
			x+=u.x; y+=u.y; z+=u.z; a += u.a;
			return *this;
		}
		T4DVector<T>& operator -=(const T4DVector<T>& u){
			x-=u.x; y-=u.y; z-=u.z; a-=u.a;
			return *this;
		}
		T4DVector<T>& operator *=(const T& u){
			x *= u; y *= u; z *= u; a *= u;
			return *this;
		}
		T4DVector<T>& operator /=(const T& u){
			assert(u != T());
			x /= u; y /= u; z /= u; a /= u;
			return *this;
		}
		
		T4DVector<T> operator +(const T4DVector<T>& u)const{
			return T4DVector<T>(x+u.x, y+u.y, z+u.z,a+u.a);
		}
		
		T4DVector<T> operator -(const T4DVector<T>& u)const{
			return T4DVector<T>(x-u.x, y-u.y, z-u.z,a-u.a);
		}
		T            operator *(const T4DVector<T>& u)const{
			return x*u.x+y*u.y+z*u.z+a*u.a;
		}
		
		T4DVector<T> operator /(const T& u)const{
			assert(u != T());
			return T4DVector<T>(x/u,y/u,z/u,a/u);
		}
		T4DVector<T> operator *(const T& u)const{
			return T4DVector<T>(x*u,y*u,z*u,a*u);
		}
		
		bool operator == (const T4DVector<T>& u)const{
			return (x == u.x && y == u.y && z == u.z && a == u.a);
		}
		bool operator != (const T4DVector<T>& u)const{
			return (x != u.x && y != u.y && z != u.z && a != u.a);
		}
		bool operator <  (const T4DVector<T>& u)const{
			return (x < u.x && y < u.y && z < u.z && a < u.a);
		}
		
		bool operator >  (const T4DVector<T>& u)const{
			return (x > u.x && y > u.y && z > u.z && a > u.a);
		}
		bool operator <= (const T4DVector<T>& u)const{
			return (x <= u.x && y <= u.y && z <= u.z && a <= u.a);
		}
		bool operator >= (const T4DVector<T>& u)const{
			return (x >= u.x && y >= u.y && z >= u.z && a >= u.a);
		}
		
		
		friend T4DVector<T> operator *(const T& a,const T4DVector<T>& b){
			return b * a;
		}
		
		/// print out the vector to the stream \a *os
		void write(std::ostream& os)const {
			os << "(" << x << ", " << y << ", " << z << "," << a << ")"; 
		}
		
		void read(std::istream& is) {
			char c; 
			
			T r,s,t,u; 
			is >> c;
			if (c == g_vector_start) {
				is >> r;
				is >> c; 
				if (c != ',') {
					is.clear(std::ios::badbit);
					return; 
				}
				is >> s; 
				is >> c; 
				if (c != ',') {
					is.clear(std::ios::badbit);
					return; 
				}
				is >> t; 
				is >> c; 
				if (c != ',') {
					is.clear(std::ios::badbit);
					return; 
				}
				is >> u; 
				is >> c; 
				if (c != g_vector_end) {
					is.clear(std::ios::badbit);
					return; 
				}
				
				x = r; 
				y = s; 
				z = t;
				a = u; 
			}else
				is.putback(c);
			
		}
	};
	
	template <class T> double fabs(const T4DVector<T>& t)
	{
		return t.norm();
	}
	
	typedef T4DVector<float> C4DFVector;
	typedef T4DVector<size_t > C4DBounds;
	
	
	/// stream output operator for 4DVector
	template <class T> 
	std::ostream& operator << (std::ostream& os, const T4DVector<T>& v)
	{
		v.write(os);
		return os; 
	}
	
	/// stream input operator for 4DVector
	template <class T> 
	std::istream& operator >> (std::istream& is, T4DVector<T>& v)
	{
		v.read(is);
		return is; 
	}

} // namespace mona
	
#endif // __MONA_4DVECTOR_HH