Point.hpp 13.2 KB
Newer Older
incardon's avatar
incardon committed
1 2 3 4 5 6 7 8 9 10
#ifndef POINT_HPP
#define POINT_HPP

#include <boost/fusion/sequence/intrinsic/at_c.hpp>
#include <boost/fusion/include/at_c.hpp>
#include <boost/fusion/container/vector.hpp>
#include <boost/fusion/include/vector.hpp>
#include <boost/fusion/container/vector/vector_fwd.hpp>
#include <boost/fusion/include/vector_fwd.hpp>
#include "boost/multi_array.hpp"
incardon's avatar
incardon committed
11
#include "Grid/Encap.hpp"
Pietro Incardona's avatar
Pietro Incardona committed
12 13
#include "Point_operators.hpp"

incardon's avatar
incardon committed
14 15 16 17 18 19 20 21 22 23 24 25

/*! \brief This class implement the point shape in an N-dimensional space
 *
 * \param T type of the space
 * \param dim dimensionality
 *
 */

template<unsigned int dim ,typename T> class Point
{
	public:

incardon's avatar
incardon committed
26
	//! Indicate that this object is vtk writable
Pietro Incardona's avatar
Pietro Incardona committed
27 28
	typedef int is_vtk_writable;

Pietro Incardona's avatar
Pietro Incardona committed
29
	//! coordinate type
incardon's avatar
incardon committed
30 31
	typedef T coord_type;

incardon's avatar
incardon committed
32
	//! boost fusion that store the point
33
	typedef boost::fusion::vector<T[dim]> type;
incardon's avatar
incardon committed
34

incardon's avatar
incardon committed
35 36 37
	//! Indicate that is a Point
	typedef int yes_is_point;

incardon's avatar
incardon committed
38 39 40 41 42 43
	//! structure that store the data of the point
	type data;

	//! Property id of the point
	static const unsigned int x = 0;

Pietro Incardona's avatar
Pietro Incardona committed
44 45 46

	/*! \brief Evaluate the expression and save the result on the point
	 *
incardon's avatar
incardon committed
47
	 * \param p_exp point expression to evaluate
Pietro Incardona's avatar
Pietro Incardona committed
48 49
	 *
	 */
50
	template<typename orig, typename exp1, typename exp2, unsigned int op> __device__ __host__ Point(const point_expression_op<orig,exp1,exp2,op> & p_exp)
Pietro Incardona's avatar
Pietro Incardona committed
51 52 53 54
	{
		this->operator=(p_exp);
	}

Pietro Incardona's avatar
Pietro Incardona committed
55 56 57 58 59
	/*! \brief Point constructor from point
	 *
	 * \param p the point
	 *
	 */
60
	__device__ __host__ inline Point(const Point<dim,T> && p)
Pietro Incardona's avatar
Pietro Incardona committed
61 62 63 64 65 66 67 68 69 70
	{
	    for(size_t i = 0; i < dim ; i++)
	    {get(i) = p.get(i);}
	}

	/*! \brief Point constructor from point
	 *
	 * \param p the point
	 *
	 */
71
	__device__ __host__ inline Point(const Point<dim,T> & p)
Pietro Incardona's avatar
Pietro Incardona committed
72 73 74 75 76 77 78 79 80 81
	{
	    for(size_t i = 0; i < dim ; i++)
	    {get(i) = p.get(i);}
	}

	/*! \brief Constructor from an array
	 *
	 * \param p array with the coordinate of the point
	 *
	 */
82
	__device__ __host__ inline Point(const T (&p)[dim])
Pietro Incardona's avatar
Pietro Incardona committed
83 84 85 86 87
	{
	    for(size_t i = 0; i < dim ; i++)
	    {get(i) = p[i];}
	}

Pietro Incardona's avatar
Pietro Incardona committed
88
	/*! \brief Constructor from scalar
incardon's avatar
incardon committed
89 90
	 *
	 * \param d scalar
Pietro Incardona's avatar
Pietro Incardona committed
91 92
	 *
	 */
93
	__device__ __host__ inline Point(T d)
Pietro Incardona's avatar
Pietro Incardona committed
94 95 96 97
	{
		this->operator=(d);
	}

Pietro Incardona's avatar
Pietro Incardona committed
98 99 100 101 102
	/*! \brief Point constructor
	 *
	 * \param p Point
	 *
	 */
incardon's avatar
incardon committed
103
	template <typename S> __device__ __host__ inline Point(const Point<dim,S> & p)
Pietro Incardona's avatar
Pietro Incardona committed
104 105
	{
		for (size_t i = 0 ; i < dim ; i++)
106
		{get(i) = static_cast<S>(p.get(i));}
Pietro Incardona's avatar
Pietro Incardona committed
107 108 109 110 111 112 113 114 115 116 117 118 119
	}

	/*! \brief Point constructor
	 *
	 * \param p encapc Point
	 *
	 */
	template <unsigned int d, typename M> inline Point(const encapc<d,Point<dim,T>,M> & p)
	{
		for (size_t i = 0 ; i < dim ; i++)
			get(i) = p.template get<0>()[i];
	}

120 121 122 123 124 125 126
	/*! \brief Point constructor from multi array
	 *
	 *
	 *
	 */
	template <typename vmpl> inline __device__ __host__  Point(const openfpm::detail::multi_array::sub_array_openfpm<T,1,vmpl> & mar)
	{
127
		for (unsigned int i = 0 ; i < dim ; i++)
128 129 130
		{get(i) = mar[i];}
	}

131 132 133 134 135 136 137 138 139 140 141
	/*! \brief Point constructor from multi array
	 *
	 *
	 *
	 */
	template <typename vmpl> inline __device__ __host__  Point(const openfpm::detail::multi_array::const_sub_array_openfpm<T,1,vmpl> & mar)
	{
		for (unsigned int i = 0 ; i < dim ; i++)
		{get(i) = mar[i];}
	}

Pietro Incardona's avatar
Pietro Incardona committed
142 143 144 145
	/*! \brief Constructor from a list
	 *
	 * [Example] Point<3,float> p({0.0,0.0,1.0})
	 *
incardon's avatar
incardon committed
146 147
	 * \param p1 initializer list
	 *
Pietro Incardona's avatar
Pietro Incardona committed
148
	 */
149
	__device__ __host__ inline Point(std::initializer_list<T> p1)
Pietro Incardona's avatar
Pietro Incardona committed
150 151 152 153 154 155 156
	{
		size_t i = 0;
	    for(T x : p1)
	    {get(i) = x;i++;}
	}

	//! Default contructor
157
	__device__ __host__  inline Point()
Pietro Incardona's avatar
Pietro Incardona committed
158 159
	{}

incardon's avatar
incardon committed
160 161 162 163 164 165
	/*! \brief Get coordinate
	 *
	 * \param i dimension
	 * \return the i-coordinate of the point
	 *
	 */
166
	__device__ __host__ inline const T & get(int i) const
incardon's avatar
incardon committed
167 168 169
	{
		return boost::fusion::at_c<x>(data)[i];
	}
170

Pietro Incardona's avatar
Pietro Incardona committed
171 172 173 174 175 176 177
	/*! \brief Get coordinate
	 *
	 * \param i dimension
	 * \return the i-coordinate of the point
	 *
	 */

178
	inline T get_vtk(size_t i) const
Pietro Incardona's avatar
Pietro Incardona committed
179 180 181 182
	{
		return boost::fusion::at_c<x>(data)[i];
	}

183 184 185 186 187 188
	/*! \brief Get coordinate
	 *
	 * \param i dimension
	 * \return the i-coordinate of the point
	 *
	 */
189
	__device__ __host__ inline T& get(int i)
190 191 192 193 194
	{
		return boost::fusion::at_c<x>(data)[i];
	}

	/*! \brief Get the component i
incardon's avatar
incardon committed
195 196
	 *
	 * \param i component
197 198 199 200 201
	 *
	 * \return the i-component
	 *
	 */

incardon's avatar
incardon committed
202
	__device__ __host__ inline T& operator[](size_t i)
203 204 205 206
	{
		return get(i);
	}

incardon's avatar
incardon committed
207 208 209 210 211 212 213 214
	/*! \brief Get the component i
	 *
	 * \param i component
	 *
	 * \return the i-component
	 *
	 */

incardon's avatar
incardon committed
215
	__device__ __host__ inline const T& operator[](size_t i) const
incardon's avatar
incardon committed
216 217 218 219
	{
		return get(i);
	}

incardon's avatar
incardon committed
220
	/*! \brief norm of the vector
Pietro Incardona's avatar
Pietro Incardona committed
221 222 223 224
	 *
	 * \return the norm of the vector
	 *
	 */
225
	__device__ __host__ T norm()
Pietro Incardona's avatar
Pietro Incardona committed
226 227 228 229 230 231 232 233 234
	{
		T n = 0.0;

		for (size_t i = 0 ; i < dim ; i++)
			n+=get(i) * get(i);

		return sqrt(n);
	}

Pietro Incardona's avatar
Pietro Incardona committed
235 236
	/*! \brief  It calculate the distance between 2 points
	 *
incardon's avatar
incardon committed
237
	 * The distance between itself (p) and the other point (q)
Pietro Incardona's avatar
Pietro Incardona committed
238
	 *
incardon's avatar
incardon committed
239
	 * \param q target point
Pietro Incardona's avatar
Pietro Incardona committed
240 241 242 243
	 *
	 * \return the distance
	 *
	 */
incardon's avatar
incardon committed
244
	__device__ __host__ T distance(const Point<dim,T> & q) const
Pietro Incardona's avatar
Pietro Incardona committed
245 246 247 248 249 250 251 252 253 254 255
	{
		T tot = 0.0;

		for (size_t i = 0 ; i < dim ; i++)
			tot += (this->get(i)  - q.get(i)) * (this->get(i)  - q.get(i));

		return sqrt(tot);
	}

	/*! \brief  It calculate the square distance between 2 points
	 *
incardon's avatar
incardon committed
256
	 * The distance between itself (p) and the other point (q)
Pietro Incardona's avatar
Pietro Incardona committed
257
	 *
incardon's avatar
incardon committed
258
	 * \param q target point
Pietro Incardona's avatar
Pietro Incardona committed
259 260 261 262
	 *
	 * \return the square of the distance
	 *
	 */
incardon's avatar
incardon committed
263
	T distance2(const Point<dim,T> & q) const
Pietro Incardona's avatar
Pietro Incardona committed
264 265 266 267 268 269 270 271 272
	{
		T tot = 0.0;

		for (size_t i = 0 ; i < dim ; i++)
			tot += (this->get(i)  - q.get(i)) * (this->get(i)  - q.get(i));

		return tot;
	}

273

incardon's avatar
incardon committed
274 275 276 277
	/*! \brief Set to zero the point coordinate
	 *
	 *
	 */
incardon's avatar
incardon committed
278
	__device__ __host__ inline void zero()
incardon's avatar
incardon committed
279 280 281 282 283 284 285
	{
		for (size_t i = 0 ; i < dim ; i++)
		{
			get(i) = 0;
		}
	}

286 287 288 289 290 291 292 293 294 295 296 297
	/*! \brief Set to one the point coordinate
	 *
	 *
	 */
	inline void one()
	{
		for (size_t i = 0 ; i < dim ; i++)
		{
			get(i) = 1;
		}
	}

298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
	/*! \brief Create a point set to zero
	 *
	 * \return a point with all coorfinate set to 0
	 *
	 */
	inline static Point<dim,T> zero_p()
	{
		Point<dim,T> p;

		for (size_t i = 0 ; i < dim ; i++)
		{
			p.get(i) = 0;
		}

		return p;
	}

incardon's avatar
incardon committed
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331
	/*! \brief Convert the point into a string
	 *
	 * \return the string
	 *
	 */
	std::string toPointString() const
	{
		std::stringstream ps;

		for (size_t i = 0 ; i < dim ; i++)
			ps << "x[" << i << "]=" << get(i) << " ";

		ps << "\n";

		return ps.str();
	}

332 333 334 335 336 337 338 339 340
	/*! \brief exchange the data of two points
	 *
	 * \param p Point to swap with
	 *
	 */
	void swap(Point<dim,T> & p)
	{
		for (size_t i = 0 ; i < dim ; i++)
		{
Pietro Incardona's avatar
Pietro Incardona committed
341
			T tmp = get(i);
342 343 344 345 346 347
			get(i) = p.get(i);
			p.get(i) = tmp;
		}
	}

	/*! \brief Check if two points match
incardon's avatar
incardon committed
348 349
	 *
	 * \param p point to compare with
350 351 352 353
	 *
	 * \return true if two points match
	 *
	 */
incardon's avatar
incardon committed
354
	__device__ __host__ inline bool operator==(const Point<dim,T> & p) const
355 356 357 358
	{
		for (size_t i = 0 ; i < dim ; i++)
		{
			if (p.get(i) != get(i))
incardon's avatar
incardon committed
359
			{return false;}
360 361 362 363 364 365
		}

		return true;
	}

	/*! \brief Check if two points match
incardon's avatar
incardon committed
366 367
	 *
	 * \param p point to compare with
368 369 370 371
	 *
	 * \return true if two points match
	 *
	 */
372
	__device__ __host__ inline bool operator!=(const Point<dim,T> & p) const
373 374 375 376
	{
		return !this->operator==(p);
	}

incardon's avatar
incardon committed
377 378 379 380 381 382 383 384 385 386
	/*! \brief Return the string with the point coordinate
	 *
	 * \return the string
	 *
	 */
	std::string to_string() const
	{
		return toString();
	}

incardon's avatar
incardon committed
387 388 389 390 391
	/*! \brief Return the string with the point coordinate
	 *
	 * \return the string
	 *
	 */
incardon's avatar
incardon committed
392
	std::string toString() const
incardon's avatar
incardon committed
393 394 395 396 397
	{
		std::string str;

		for (size_t i = 0 ; i < dim - 1 ; i++)
		{
incardon's avatar
Fixing  
incardon committed
398
			// coverty[dead_error_line]
Pietro Incardona's avatar
Pietro Incardona committed
399
			str += std::to_string(static_cast<double>(get(i))) + " ";
incardon's avatar
incardon committed
400
		}
Pietro Incardona's avatar
Pietro Incardona committed
401
		str += std::to_string(static_cast<double>(get(dim-1)));
incardon's avatar
incardon committed
402 403 404 405

		return str;
	}

406
	/*! \brief Return the reference to the value at coordinate i
incardon's avatar
incardon committed
407 408
	 *
	 * \param i coordinate to return
409
	 *
410
	 * \return the reference
411 412 413 414 415 416 417
	 *
	 */
	T & value(size_t i)
	{
		return get(i);
	}

418
	/*! \brief Return the value at coordinate i
incardon's avatar
incardon committed
419 420
	 *
	 * \param i coordinate to return
421
	 *
422
	 * \return the value
423 424
	 *
	 */
Pietro Incardona's avatar
Pietro Incardona committed
425
	inline T value(size_t i) const
426 427 428 429
	{
		return get(i);
	}

430 431 432 433 434 435 436 437 438 439
	/*! \brief Return the coordinated of the point as reference array
	 *
	 * \return the reference array
	 *
	 */
	T (&asArray())[dim]
	{
		return boost::fusion::at_c<x>(data);
	}

incardon's avatar
incardon committed
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454
	/*! Convert the point from Point<dim,T> to Point<dim,A>
	 *
	 * \return the converted point
	 *
	 */
	template<typename A> Point<dim,A> convertPoint() const
	{
		Point<dim,A> p;

		for (size_t i = 0; i < dim ; i++)
			p.get(i) = static_cast<A>(get(i));

		return p;
	}

Pietro Incardona's avatar
Pietro Incardona committed
455

456 457 458 459 460 461
	//! This structure has no internal pointers
	static bool noPointers()
	{
		return true;
	}

Pietro Incardona's avatar
Pietro Incardona committed
462 463 464 465
	////////////////////////////////////////////////////////////////
	////////////////////// ARITMETIC OPERATORS /////////////////////
	////////////////////////////////////////////////////////////////

incardon's avatar
incardon committed
466 467 468
	/*! \brief Fill the vector with the evaluated expression
	 *
	 * \param p_exp expression to evaluate
Pietro Incardona's avatar
Pietro Incardona committed
469
	 *
incardon's avatar
incardon committed
470
	 * \return itself
Pietro Incardona's avatar
Pietro Incardona committed
471 472
	 *
	 */
473
	template<typename orig, typename exp1, typename exp2, unsigned int op> __device__ __host__ Point<dim,T> & operator=(const point_expression_op<orig,exp1,exp2,op> & p_exp)
Pietro Incardona's avatar
Pietro Incardona committed
474 475 476 477
	{
		p_exp.init();

		for (size_t i = 0; i < dim ; i++)
incardon's avatar
incardon committed
478
		{get(i) = p_exp.value(i);}
Pietro Incardona's avatar
Pietro Incardona committed
479 480 481 482

		return *this;
	}

483 484
	/*! \brief Fill the vector property with the evaluated expression
	 *
incardon's avatar
incardon committed
485 486 487
	 * \param p_exp expression to evaluate
	 *
	 * \return itself
488 489
	 *
	 */
490
	__device__ __host__ Point<dim,T> & operator=(const point_expression<T[dim]> & p_exp)
491 492
	{
		p_exp.init();
incardon's avatar
incardon committed
493 494 495 496 497 498 499

		for (size_t i = 0; i < dim ; i++)
			get(i) = p_exp.value(i);

		return *this;
	}

incardon's avatar
incardon committed
500
	/*! \brief Fill the point with the value specified in the array
incardon's avatar
incardon committed
501
	 *
incardon's avatar
incardon committed
502
	 * \param p array
incardon's avatar
incardon committed
503 504 505 506
	 *
	 * \return itself
	 *
	 */
507
	__device__ __host__ Point<dim,T> & operator=(const T (& p)[dim])
incardon's avatar
incardon committed
508 509 510 511 512 513 514
	{
		for (size_t i = 0; i < dim ; i++)
			get(i) = p[i];

		return *this;
	}

incardon's avatar
incardon committed
515 516 517 518 519 520 521 522 523
	/*! \brief Fill the vector property with the evaluated expression
	 *
	 * \tparam check disable this method if T is a constant
	 *
	 * \param p_exp expression to evaluate
	 *
	 * \return itself
	 *
	 */
524
	template<typename T1, typename check = typename std::enable_if<std::is_const<T1>::value == false>::type> __device__ __host__ Point<dim,T> & operator=(const point_expression<const T1[dim]> & p_exp)
incardon's avatar
incardon committed
525 526
	{
		p_exp.init();
527 528 529 530 531 532 533

		for (size_t i = 0; i < dim ; i++)
			get(i) = p_exp.value(i);

		return *this;
	}

incardon's avatar
incardon committed
534
	/*! \brief divide each component by an array
Pietro Incardona's avatar
Pietro Incardona committed
535 536 537
	 *
	 * \param ar Component wise division
	 *
incardon's avatar
incardon committed
538 539
	 * \return itself
	 *
Pietro Incardona's avatar
Pietro Incardona committed
540
	 */
541
	template<typename aT> __device__ __host__ inline Point<dim,T> operator/(const aT (&ar)[dim])
Pietro Incardona's avatar
Pietro Incardona committed
542 543 544 545 546 547 548 549 550
	{
		Point<dim,T> result;

		for (size_t i = 0 ; i < dim ; i++)
			result.get(i) = get(i) / ar[i];

		return result;
	}

incardon's avatar
incardon committed
551
	/*! \brief divide each component by a constant
Pietro Incardona's avatar
Pietro Incardona committed
552
	 *
incardon's avatar
incardon committed
553 554 555
	 * \param c constant
	 *
	 * \return itself
Pietro Incardona's avatar
Pietro Incardona committed
556 557
	 *
	 */
558
	template<typename aT> __device__ __host__ inline Point<dim,T> operator/=(const aT c)
Pietro Incardona's avatar
Pietro Incardona committed
559 560 561 562 563 564 565 566
	{
		for (size_t i = 0 ; i < dim ; i++)
			get(i) = get(i) / c;

		return *this;
	}


incardon's avatar
incardon committed
567
	/*! \brief Fill the vector property with some value
Pietro Incardona's avatar
Pietro Incardona committed
568 569 570
	 *
	 * \param d value to fill
	 *
incardon's avatar
incardon committed
571 572
	 * \return itself
	 *
Pietro Incardona's avatar
Pietro Incardona committed
573
	 */
574
	__device__ __host__ Point<dim,T> & operator=(T d)
Pietro Incardona's avatar
Pietro Incardona committed
575 576 577 578 579 580 581 582 583 584 585
	{
		for (size_t i = 0; i < dim ; i++)
			get(i) = d;

		return *this;
	}

	/*! \brief operator= between points
	 *
	 * \param p Point
	 *
incardon's avatar
incardon committed
586 587
	 * \return itself
	 *
Pietro Incardona's avatar
Pietro Incardona committed
588
	 */
589
	__device__ __host__ inline Point<dim,T> & operator=(const Point<dim,T> & p)
Pietro Incardona's avatar
Pietro Incardona committed
590 591 592 593 594 595 596
	{
		for (size_t i = 0 ; i < dim ; i++)
			get(i) = p.get(i);

		return *this;
	}

incardon's avatar
incardon committed
597
	/*! \brief Subtract two points
Pietro Incardona's avatar
Pietro Incardona committed
598
	 *
incardon's avatar
incardon committed
599 600 601
	 * \param p point to subtract
	 *
	 * \return itself
Pietro Incardona's avatar
Pietro Incardona committed
602 603
	 *
	 */
604
	__device__ __host__ inline Point<dim,T> & operator-=(const Point<dim,T> & p)
Pietro Incardona's avatar
Pietro Incardona committed
605 606 607 608 609 610 611
	{
		for (size_t i = 0 ; i < dim ; i++)
			get(i) -= p.get(i);

		return *this;
	}

incardon's avatar
incardon committed
612
	/*! \brief Sum two points
Pietro Incardona's avatar
Pietro Incardona committed
613
	 *
incardon's avatar
incardon committed
614 615 616
	 * \param p point to sum
	 *
	 * \return itself
Pietro Incardona's avatar
Pietro Incardona committed
617 618
	 *
	 */
619
	__device__ __host__ inline Point<dim,T> & operator+=(const Point<dim,T> & p)
Pietro Incardona's avatar
Pietro Incardona committed
620 621
	{
		for (size_t i = 0 ; i < dim ; i++)
622
		{get(i) += p.get(i);}
Pietro Incardona's avatar
Pietro Incardona committed
623 624 625 626 627 628 629 630 631

		return *this;
	}

	/*! \brief Do nothing stub operation
	 *
	 * Required to make the code compilable
	 *
	 */
632
	__device__ __host__ inline void init() const
Pietro Incardona's avatar
Pietro Incardona committed
633 634 635 636 637
	{}

	///////////////////////////////////////////////////////////////////////
	///////////////////////////////////////////////////////////////////////

incardon's avatar
incardon committed
638
	//! The point has one property
639
	static const unsigned int max_prop = 1;
incardon's avatar
incardon committed
640 641 642
	static const unsigned int max_prop_real = 1;

	//! expose the dimension
643
	static const unsigned int dims = dim;
incardon's avatar
incardon committed
644 645

	//! expose the dimension with a different name
Pietro Incardona's avatar
Pietro Incardona committed
646
	static const unsigned int nvals = dim;
incardon's avatar
incardon committed
647 648
};

incardon's avatar
incardon committed
649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685
/*! \brief Convert an array of point coordinate into string
 *
 * \param p coordinate on each dimension
 *
 * \return the string
 *
 */
template <unsigned int N, typename T> std::string toPointString(const T (&p)[N] )
{
	std::stringstream ps;

	for (size_t i = 0 ; i < N ; i++)
		ps << "x[" << i << "]=" << p[i] << " ";

	ps << "\n";

	return ps.str();
}

/*! \brief Convert an encapsulated point into string
 *
 * \param p coordinate on each dimension
 *
 * \return the string
 *
 */
template <unsigned int N, typename T, typename Mem> std::string toPointString(const encapc<1,Point<N,T>,Mem> & p )
{
	std::stringstream ps;

	for (size_t i = 0 ; i < N ; i++)
		ps << "x[" << i << "]=" << p.template get<Point<N,T>::x>()[i] << " ";

	ps << "\n";

	return ps.str();
}
incardon's avatar
incardon committed
686

Pietro Incardona's avatar
Pietro Incardona committed
687

Pietro Incardona's avatar
Pietro Incardona committed
688 689 690 691
//! A point is a vector on a computer (But do not say this to a Mathematician)

template<unsigned int dim, typename T>  using VectorS = Point<dim,T>;

incardon's avatar
incardon committed
692 693 694 695 696 697 698 699 700 701 702 703 704
template<typename T, typename Sfinae = void>
struct is_Point: std::false_type {};


/*! \brief Check if a type T is an aggregate
 *
 * return true if T is an aggregate
 *
 */
template<typename T>
struct is_Point<T, typename Void< typename T::yes_is_point>::type> : std::true_type
{};

incardon's avatar
incardon committed
705
#endif