x10.array
Class Point

x10.lang.Object
  extended by x10.array.Point
All Implemented Interfaces:
Any

final public class Point
extends Object
implements x10.lang. Fun_0_1<Int,Int>, Ordered<Point>, Comparable<Point>

Declaration: Point extends x10.lang.Object implements (a1:x10.lang.Int)=>x10.lang.Int, x10.util.Ordered[x10.array.Point{self.rank==this(:x10.array.Point).rank}], x10.lang.Comparable[x10.array.Point{self.rank==this(:x10.array.Point).rank}].

The type Point(rank) represents a point in a
rank-dimensional space. The coordinates of a point p
may be accessed individually (with zero-based indexing) using
p(i) because Point implements
(Int)=>int. The coordinates may also be accessed as a
Array[int]. Point arithmetic is supported.


Field Summary
 Int rank
          Property.
 
Method Summary
 Int operator()(Int i)
          Returns the value of the ith coordinate.
 x10.lang. Fun_0_1<Int,Int> coords()
          Declaration: coords(): (a1:x10.lang.Int)=>x10.lang.Int. Returns the coordinates as a (int)=>int.
static
<T> Point
make(Array<T> r)
          Declaration: make[T](r:x10.array.Array[T]{self.rank==1}){}: x10.array.Point{self.rank==r.size}. Constructs a Point from a Array[int](1)
static Point make(Int rank, x10.lang. Fun_0_1<Int,Int> init)
          Declaration: make(rank:x10.lang.Int,init:(a1:x10.lang.Int)=>x10.lang.Int): x10.array.Point{self.rank==rank}. Returns a Point p of rank rank with p(i)=init(i).
static Point make(Int i0)
          Declaration: make(i0:x10.lang.Int): x10.array.Point{self.rank==1, self!=null}.
static Point make(Int i0, Int i1)
          Declaration: make(i0:x10.lang.Int,i1:x10.lang.Int): x10.array.Point{self.rank==2, self!=null}.
static Point make(Int i0, Int i1, Int i2)
          Declaration: make(i0:x10.lang.Int,i1:x10.lang.Int,i2:x10.lang.Int): x10.array.Point{self.rank==3, self!=null}.
static Point make(Int i0, Int i1, Int i2, Int i3)
          Declaration: make(i0:x10.lang.Int,i1:x10.lang.Int,i2:x10.lang.Int,i3:x10.lang.Int): x10.array.Point{self.rank==4, self!=null}.
static
<T> Point
implicit_operator_as(Array<T> a)
          Declaration: implicit_operator_as[T](a:x10.array.Array[T]{self.rank==1}){}: x10.array.Point{self.rank==a.size}. A Array r of length k can be converted to a point p of the same rank with p(i)=r(i).
 Point operator+()
          Declaration: operator+(): x10.array.Point{self.rank==this(:x10.array.Point).rank}. The point +p is the same as p.
 Point operator-()
          Declaration: operator-(): x10.array.Point{self.rank==this(:x10.array.Point).rank}. The point -p is the same as p with each index negated.
 Point operator+(Point that)
          Declaration: operator+(that:x10.array.Point{self.rank==this(:x10.array.Point).rank}): x10.array.Point{self.rank==this(:x10.array.Point).rank}. The ith coordinate of point p+q is p(i)+q(i).
 Point operator-(Point that)
          Declaration: operator-(that:x10.array.Point{self.rank==this(:x10.array.Point).rank}): x10.array.Point{self.rank==this(:x10.array.Point).rank}. The ith coordinate of point p-q is p(i)-q(i).
 Point operator*(Point that)
          Declaration: operator*(that:x10.array.Point{self.rank==this(:x10.array.Point).rank}): x10.array.Point{self.rank==this(:x10.array.Point).rank}. The ith coordinate of point p q is p(i) q(i).
 Point operator/(Point that)
          Declaration: operator/(that:x10.array.Point{self.rank==this(:x10.array.Point).rank}): x10.array.Point{self.rank==this(:x10.array.Point).rank}. The ith coordinate of point p/q is p(i)/q(i).
 Point operator+(Int c)
          Declaration: operator+(c:x10.lang.Int): x10.array.Point{self.rank==this(:x10.array.Point).rank}. The ith coordinate of point p+c is p(i)+c.
 Point operator-(Int c)
          Declaration: operator-(c:x10.lang.Int): x10.array.Point{self.rank==this(:x10.array.Point).rank}. The ith coordinate of point p-c is p(i)-c.
 Point operator*(Int c)
          Declaration: operator*(c:x10.lang.Int): x10.array.Point{self.rank==this(:x10.array.Point).rank}. The ith coordinate of point p c is p(i) c.
 Point operator/(Int c)
          Declaration: operator/(c:x10.lang.Int): x10.array.Point{self.rank==this(:x10.array.Point).rank}. The ith coordinate of point p/c is p(i)/c.
 Point inverse_operator+(Int c)
          Declaration: inverse_operator+(c:x10.lang.Int): x10.array.Point{self.rank==this(:x10.array.Point).rank}. The ith coordinate of point c+p is c+p(i).
 Point inverse_operator-(Int c)
          Declaration: inverse_operator-(c:x10.lang.Int): x10.array.Point{self.rank==this(:x10.array.Point).rank}. The ith coordinate of point c-p is c-p(i).
 Point inverse_operator*(Int c)
          Declaration: inverse_operator*(c:x10.lang.Int): x10.array.Point{self.rank==this(:x10.array.Point).rank}. The ith coordinate of point c p is c p(i).
 Point inverse_operator/(Int c)
          Declaration: inverse_operator/(c:x10.lang.Int): x10.array.Point{self.rank==this(:x10.array.Point).rank}. The ith coordinate of point c/p is c/p(i).
 Int compareTo(Point that)
          Declaration: compareTo(that:x10.array.Point{self.rank==this(:x10.array.Point).rank}): x10.lang.Int. Comparable#compareTo
 Int hashCode()
          Compute the hashCode of a point by combining the the coordinates in a multiple/xor chain.
 Boolean equals(Any other)
          Two points of the same rank are equal if and only if their corresponding indices are equal.
 Boolean operator<(Point that)
          Declaration: operator<(that:x10.array.Point{self.rank==this(:x10.array.Point).rank}): x10.lang.Boolean. For points a, b, a < b if a is lexicographically smaller than b.
 Boolean operator>(Point that)
          Declaration: operator>(that:x10.array.Point{self.rank==this(:x10.array.Point).rank}): x10.lang.Boolean. For points a, b, a > b if a is lexicographically bigger than b.
 Boolean operator<=(Point that)
          Declaration: operator<=(that:x10.array.Point{self.rank==this(:x10.array.Point).rank}): x10.lang.Boolean. For points a, b, a ≤ b if a is lexicographically less than b or the same as b.
 Boolean operator>=(Point that)
          Declaration: operator>=(that:x10.array.Point{self.rank==this(:x10.array.Point).rank}): x10.lang.Boolean. For points a, b, a ≥ b if a is lexicographically greater than b or the same as b.
 String toString()
          A point with coordinates i1,..., ik is printed as [i1,.., ik].
 Point x10$array$Point$$x10$array$Point$this()
          Declaration: x10$array$Point$$x10$array$Point$this(): x10.array.Point{self==this(:x10.array.Point)}. The type Point(rank) represents a point in a rank-dimensional space.
 
Methods inherited from class x10.lang.Object
equals, hashCode, toString, typeName, x10$lang$Object$$x10$lang$Object$this
 
Methods inherited from interface x10.lang. Fun_0_1
operator()
 
Methods inherited from interface x10.util.Ordered
operator<, operator>, operator<=, operator>=
 
Methods inherited from interface x10.lang.Comparable
compareTo
 
Methods inherited from interface x10.lang.Any
toString, typeName, equals, hashCode
 

Field Detail

rank

public final Int rank
Property.

Method Detail

operator()

public Int operator()(Int i)
Returns the value of the ith coordinate.


coords

public x10.lang. Fun_0_1<Int,Int> coords()
Declaration: coords(): (a1:x10.lang.Int)=>x10.lang.Int.
Returns the coordinates as a (int)=>int.


make

public static <T> Point make(Array<T> r)
Declaration: make[T](r:x10.array.Array[T]{self.rank==1}){}: x10.array.Point{self.rank==r.size}.
Constructs a Point from a Array[int](1)


make

public static Point make(Int rank,
                         x10.lang. Fun_0_1<Int,Int> init)
Declaration: make(rank:x10.lang.Int,init:(a1:x10.lang.Int)=>x10.lang.Int): x10.array.Point{self.rank==rank}.
Returns a Point p of rank rank with p(i)=init(i).


make

public static Point make(Int i0)
Declaration: make(i0:x10.lang.Int): x10.array.Point{self.rank==1, self!=null}.


make

public static Point make(Int i0,
                         Int i1)
Declaration: make(i0:x10.lang.Int,i1:x10.lang.Int): x10.array.Point{self.rank==2, self!=null}.


make

public static Point make(Int i0,
                         Int i1,
                         Int i2)
Declaration: make(i0:x10.lang.Int,i1:x10.lang.Int,i2:x10.lang.Int): x10.array.Point{self.rank==3, self!=null}.


make

public static Point make(Int i0,
                         Int i1,
                         Int i2,
                         Int i3)
Declaration: make(i0:x10.lang.Int,i1:x10.lang.Int,i2:x10.lang.Int,i3:x10.lang.Int): x10.array.Point{self.rank==4, self!=null}.


implicit_operator_as

public static <T> Point implicit_operator_as(Array<T> a)
Declaration: implicit_operator_as[T](a:x10.array.Array[T]{self.rank==1}){}: x10.array.Point{self.rank==a.size}.
A Array r of length k can be converted to a point p
        of the same rank with p(i)=r(i).


operator+

public Point operator+()
Declaration: operator+(): x10.array.Point{self.rank==this(:x10.array.Point).rank}.
The point +p is the same as p.


operator-

public Point operator-()
Declaration: operator-(): x10.array.Point{self.rank==this(:x10.array.Point).rank}.
The point -p is the same as p with each index negated.


operator+

public Point operator+(Point that)
Declaration: operator+(that:x10.array.Point{self.rank==this(:x10.array.Point).rank}): x10.array.Point{self.rank==this(:x10.array.Point).rank}.
The ith coordinate of point p+q is p(i)+q(i).


operator-

public Point operator-(Point that)
Declaration: operator-(that:x10.array.Point{self.rank==this(:x10.array.Point).rank}): x10.array.Point{self.rank==this(:x10.array.Point).rank}.
The ith coordinate of point p-q is p(i)-q(i).


operator*

public Point operator*(Point that)
Declaration: operator*(that:x10.array.Point{self.rank==this(:x10.array.Point).rank}): x10.array.Point{self.rank==this(:x10.array.Point).rank}.
The ith coordinate of point p
q is p(i)
q(i).


operator/

public Point operator/(Point that)
Declaration: operator/(that:x10.array.Point{self.rank==this(:x10.array.Point).rank}): x10.array.Point{self.rank==this(:x10.array.Point).rank}.
The ith coordinate of point p/q is p(i)/q(i).


operator+

public Point operator+(Int c)
Declaration: operator+(c:x10.lang.Int): x10.array.Point{self.rank==this(:x10.array.Point).rank}.
The ith coordinate of point p+c is p(i)+c.


operator-

public Point operator-(Int c)
Declaration: operator-(c:x10.lang.Int): x10.array.Point{self.rank==this(:x10.array.Point).rank}.
The ith coordinate of point p-c is p(i)-c.


operator*

public Point operator*(Int c)
Declaration: operator*(c:x10.lang.Int): x10.array.Point{self.rank==this(:x10.array.Point).rank}.
The ith coordinate of point p
c is p(i)
c.


operator/

public Point operator/(Int c)
Declaration: operator/(c:x10.lang.Int): x10.array.Point{self.rank==this(:x10.array.Point).rank}.
The ith coordinate of point p/c is p(i)/c.


inverse_operator+

public Point inverse_operator+(Int c)
Declaration: inverse_operator+(c:x10.lang.Int): x10.array.Point{self.rank==this(:x10.array.Point).rank}.
The ith coordinate of point c+p is c+p(i).


inverse_operator-

public Point inverse_operator-(Int c)
Declaration: inverse_operator-(c:x10.lang.Int): x10.array.Point{self.rank==this(:x10.array.Point).rank}.
The ith coordinate of point c-p is c-p(i).


inverse_operator*

public Point inverse_operator*(Int c)
Declaration: inverse_operator*(c:x10.lang.Int): x10.array.Point{self.rank==this(:x10.array.Point).rank}.
The ith coordinate of point c
p is c
p(i).


inverse_operator/

public Point inverse_operator/(Int c)
Declaration: inverse_operator/(c:x10.lang.Int): x10.array.Point{self.rank==this(:x10.array.Point).rank}.
The ith coordinate of point c/p is c/p(i).


compareTo

public Int compareTo(Point that)
Declaration: compareTo(that:x10.array.Point{self.rank==this(:x10.array.Point).rank}): x10.lang.Int.
Comparable#compareTo


hashCode

public Int hashCode()
Compute the hashCode of a point by combining the the coordinates in a multiple/xor chain. This should increase the randomness and overcomes the fact that coordinates are biased to be small positive numbers.


equals

public Boolean equals(Any other)
Two points of the same rank are equal if and only if their corresponding indices are equal.


operator<

public Boolean operator<(Point that)
Declaration: operator<(that:x10.array.Point{self.rank==this(:x10.array.Point).rank}): x10.lang.Boolean.
For points a, b,  a < b if a is lexicographically smaller than b.


operator>

public Boolean operator>(Point that)
Declaration: operator>(that:x10.array.Point{self.rank==this(:x10.array.Point).rank}): x10.lang.Boolean.
For points a, b,  a > b if a is lexicographically bigger than
         b.


operator<=

public Boolean operator<=(Point that)
Declaration: operator<=(that:x10.array.Point{self.rank==this(:x10.array.Point).rank}): x10.lang.Boolean.
For points a, b,  a ≤ b if a is lexicographically less than
         b or the same as b.


operator>=

public Boolean operator>=(Point that)
Declaration: operator>=(that:x10.array.Point{self.rank==this(:x10.array.Point).rank}): x10.lang.Boolean.
For points a, b,  a ≥ b if a is lexicographically greater than
         b or the same as b.


toString

public String toString()
A point with coordinates i1,..., ik is printed as [i1,.., ik].


x10$array$Point$$x10$array$Point$this

public final Point x10$array$Point$$x10$array$Point$this()
Declaration: x10$array$Point$$x10$array$Point$this(): x10.array.Point{self==this(:x10.array.Point)}.
The type Point(rank) represents a point in a
rank-dimensional space. The coordinates of a point p
may be accessed individually (with zero-based indexing) using
p(i) because Point implements
(Int)=>int. The coordinates may also be accessed as a
Array[int]. Point arithmetic is supported.