Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions jmeos-core/src/main/java/types/basic/tpoint/TPoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ default Point value_at_timestamp(LocalDateTime ts, int precision) throws ParseEx
* @return A {@link Float} with the length of the trajectory.
*/
default float length(){
return (float) GeneratedFunctions.tpoint_length(getPointInner());
return (float) GeneratedFunctions.tpoint_length(getPointInner(), true);
}


Expand All @@ -301,7 +301,7 @@ default float length(){
* @return A {@link TFloat} with the cumulative length of the trajectory.
*/
default TFloat cumulative_length(){
return (TFloat) Factory.create_temporal(GeneratedFunctions.tpoint_cumulative_length(getPointInner()),"Float",getTemporalType());
return (TFloat) Factory.create_temporal(GeneratedFunctions.tpoint_cumulative_length(getPointInner(), true),"Float",getTemporalType());
}


Expand All @@ -314,7 +314,7 @@ default TFloat cumulative_length(){
* @return A {@link TFloat} with the speed of the temporal point.
*/
default TFloat speed(){
return (TFloat) Factory.create_temporal(GeneratedFunctions.tpoint_speed(getPointInner()),"Float",getTemporalType());
return (TFloat) Factory.create_temporal(GeneratedFunctions.tpoint_speed(getPointInner(), true),"Float",getTemporalType());
}


Expand Down Expand Up @@ -939,11 +939,11 @@ default boolean is_ever_disjoint(Object other) throws OperationNotSupportedExcep
*/
default boolean is_ever_within_distance(Object other, float distance) throws OperationNotSupportedException {
if (other instanceof Geometry){
return 1 == GeneratedFunctions.edwithin_tgeo_geo( getPointInner(), ConversionUtils.geo_to_gserialized((Geometry) other, this instanceof TGeogPoint), distance);
return 1 == GeneratedFunctions.edwithin_tgeo_geo( getPointInner(), ConversionUtils.geo_to_gserialized((Geometry) other, this instanceof TGeogPoint), distance, true);
} else if (other instanceof STBox) {
return 1 == GeneratedFunctions.edwithin_tgeo_geo(getPointInner(), GeneratedFunctions.stbox_to_geo(((STBox) other).get_inner()), distance);
return 1 == GeneratedFunctions.edwithin_tgeo_geo(getPointInner(), GeneratedFunctions.stbox_to_geo(((STBox) other).get_inner()), distance, true);
} else if (other instanceof TPoint) {
return 1 == GeneratedFunctions.edwithin_tgeo_tgeo(getPointInner(), ((TPoint) other).getPointInner(), distance);
return 1 == GeneratedFunctions.edwithin_tgeo_tgeo(getPointInner(), ((TPoint) other).getPointInner(), distance, true);
} else{
throw new OperationNotSupportedException("Operand not supported");
}
Expand Down Expand Up @@ -1058,11 +1058,11 @@ default TBool disjoint(Object other) throws OperationNotSupportedException {
*/
default TBool within_distance(Object other, float distance) throws OperationNotSupportedException {
if (other instanceof Geometry){
return (TBool) Factory.create_temporal(GeneratedFunctions.tdwithin_tgeo_geo(getPointInner(),ConversionUtils.geo_to_gserialized((Geometry) other, this instanceof TGeogPoint), distance), "Boolean", getTemporalType() ) ;
return (TBool) Factory.create_temporal(GeneratedFunctions.tdwithin_tgeo_geo(getPointInner(),ConversionUtils.geo_to_gserialized((Geometry) other, this instanceof TGeogPoint), distance, true), "Boolean", getTemporalType() ) ;
} else if (other instanceof STBox) {
return (TBool) Factory.create_temporal(GeneratedFunctions.tdwithin_tgeo_geo(getPointInner(),GeneratedFunctions.stbox_to_geo(((STBox) other).get_inner()), distance), "Boolean", getTemporalType() );
return (TBool) Factory.create_temporal(GeneratedFunctions.tdwithin_tgeo_geo(getPointInner(),GeneratedFunctions.stbox_to_geo(((STBox) other).get_inner()), distance, true), "Boolean", getTemporalType() );
} else if(other instanceof TPoint){
return (TBool) Factory.create_temporal(GeneratedFunctions.tdwithin_tgeo_tgeo(getPointInner(),((TPoint) other).getPointInner(), distance), "Boolean", getTemporalType() );
return (TBool) Factory.create_temporal(GeneratedFunctions.tdwithin_tgeo_tgeo(getPointInner(),((TPoint) other).getPointInner(), distance, true), "Boolean", getTemporalType() );
}else{
throw new OperationNotSupportedException("Operand not supported");
}
Expand Down Expand Up @@ -1128,11 +1128,11 @@ default TBool touches(Object other) throws OperationNotSupportedException {
*/
default TFloat distance(Object other) throws OperationNotSupportedException {
if (other instanceof Geometry){
return (TFloat) Factory.create_temporal(GeneratedFunctions.tdistance_tgeo_geo(getPointInner(),ConversionUtils.geo_to_gserialized((Geometry) other, this instanceof TGeogPoint)), "Float", getTemporalType() ) ;
return (TFloat) Factory.create_temporal(GeneratedFunctions.tdistance_tgeo_geo(getPointInner(),ConversionUtils.geo_to_gserialized((Geometry) other, this instanceof TGeogPoint), true), "Float", getTemporalType() ) ;
} else if (other instanceof STBox) {
return (TFloat) Factory.create_temporal(GeneratedFunctions.tdistance_tgeo_geo(getPointInner(),GeneratedFunctions.stbox_to_geo(((STBox) other).get_inner())), "Float", getTemporalType() );
return (TFloat) Factory.create_temporal(GeneratedFunctions.tdistance_tgeo_geo(getPointInner(),GeneratedFunctions.stbox_to_geo(((STBox) other).get_inner()), true), "Float", getTemporalType() );
} else if(other instanceof TPoint){
return (TFloat) Factory.create_temporal(GeneratedFunctions.tdistance_tgeo_tgeo(getPointInner(),((TPoint) other).getPointInner()), "Float", getTemporalType() );
return (TFloat) Factory.create_temporal(GeneratedFunctions.tdistance_tgeo_tgeo(getPointInner(),((TPoint) other).getPointInner(), true), "Float", getTemporalType() );
}else{
throw new OperationNotSupportedException("Operand not supported");
}
Expand All @@ -1153,11 +1153,11 @@ default TFloat distance(Object other) throws OperationNotSupportedException {
*/
default float nearest_approach_distance(Object other) throws OperationNotSupportedException {
if (other instanceof Geometry){
return (float) GeneratedFunctions.nad_tgeo_geo( getPointInner(), ConversionUtils.geo_to_gserialized((Geometry) other, this instanceof TGeogPoint));
return (float) GeneratedFunctions.nad_tgeo_geo( getPointInner(), ConversionUtils.geo_to_gserialized((Geometry) other, this instanceof TGeogPoint), true);
} else if (other instanceof STBox) {
return (float) GeneratedFunctions.nad_tgeo_stbox(getPointInner(), GeneratedFunctions.stbox_to_geo(((STBox) other).get_inner()));
return (float) GeneratedFunctions.nad_tgeo_stbox(getPointInner(), GeneratedFunctions.stbox_to_geo(((STBox) other).get_inner()), true);
} else if (other instanceof TPoint) {
return (float) GeneratedFunctions.nad_tgeo_tgeo(getPointInner(), ((TPoint) other).getPointInner());
return (float) GeneratedFunctions.nad_tgeo_tgeo(getPointInner(), ((TPoint) other).getPointInner(), true);
} else{
throw new OperationNotSupportedException("Operand not supported");
}
Expand All @@ -1177,9 +1177,9 @@ default float nearest_approach_distance(Object other) throws OperationNotSupport
*/
default TInstant nearest_approach_instant(Object other) throws OperationNotSupportedException {
if (other instanceof Geometry){
return (TInstant) Factory.create_temporal(GeneratedFunctions.nai_tgeo_geo(getPointInner(),ConversionUtils.geo_to_gserialized((Geometry) other, this instanceof TGeogPoint)), getCustomType(), getTemporalType() ) ;
return (TInstant) Factory.create_temporal(GeneratedFunctions.nai_tgeo_geo(getPointInner(),ConversionUtils.geo_to_gserialized((Geometry) other, this instanceof TGeogPoint), true), getCustomType(), getTemporalType() ) ;
} else if(other instanceof TPoint){
return (TInstant) Factory.create_temporal(GeneratedFunctions.nai_tgeo_tgeo(getPointInner(),((TPoint) other).getPointInner()), getCustomType(), getTemporalType() );
return (TInstant) Factory.create_temporal(GeneratedFunctions.nai_tgeo_tgeo(getPointInner(),((TPoint) other).getPointInner(), true), getCustomType(), getTemporalType() );
}else{
throw new OperationNotSupportedException("Operand not supported");
}
Expand All @@ -1204,9 +1204,9 @@ default Geometry shortest_line(Object other) throws OperationNotSupportedExcepti
if (other instanceof Geometry){
boolean b= this instanceof TGeogPoint;
Pointer gs= ConversionUtils.geo_to_gserialized((Geometry) other, b);
res= GeneratedFunctions.shortestline_tgeo_geo(this.getPointInner(), gs);
res= GeneratedFunctions.shortestline_tgeo_geo(this.getPointInner(), gs, true);
} else if(other instanceof TPoint){
res= GeneratedFunctions.shortestline_tgeo_geo(this.getPointInner(), ((TPoint) other).getPointInner());
res= GeneratedFunctions.shortestline_tgeo_geo(this.getPointInner(), ((TPoint) other).getPointInner(), true);
}else{
throw new OperationNotSupportedException("Operand not supported");
}
Expand Down
6 changes: 3 additions & 3 deletions jmeos-core/src/main/java/types/boxes/STBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ public boolean is_over_or_after(TemporalObject other) throws Exception {
* @return a Float instance with the distance between the nearest points of "this" and "``other``".
*/
public float nearest_approach_distance_geom(Geometry other) {
return (float) GeneratedFunctions.nad_stbox_geo(this._inner, ConversionUtils.geo_to_gserialized(other, this.geodetic()));
return (float) GeneratedFunctions.nad_stbox_geo(this._inner, ConversionUtils.geo_to_gserialized(other, this.geodetic()), true);
}


Expand All @@ -1070,7 +1070,7 @@ public float nearest_approach_distance_geom(Geometry other) {
* @return a Float instance with the distance between the nearest points of "this" and "``other``".
*/
public float nearest_approach_distance_stbox(STBox other) {
return (float) GeneratedFunctions.nad_stbox_stbox(this._inner, other._inner);
return (float) GeneratedFunctions.nad_stbox_stbox(this._inner, other._inner, true);
}


Expand All @@ -1088,7 +1088,7 @@ public float nearest_approach_distance_stbox(STBox other) {
* @return a Float instance with the distance between the nearest points of "this" and "``other``".
*/
public float nearest_approach_distance_tpoint(TPoint other) {
return (float) GeneratedFunctions.nad_tgeo_stbox(this._inner, other.getPointInner());
return (float) GeneratedFunctions.nad_tgeo_stbox(this._inner, other.getPointInner(), true);
}


Expand Down
6 changes: 3 additions & 3 deletions jmeos-core/src/main/java/types/temporal/Temporal.java
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ public boolean is_over_or_after(TemporalObject other) throws Exception {
* @return A {@link Float} with the Frechet distance.
*/
public float frechet_distance(Temporal other){
return (float) GeneratedFunctions.temporal_frechet_distance(this.inner,other.getInner());
return (float) GeneratedFunctions.temporal_frechet_distance(this.inner,other.getInner(), true);
}

/**
Expand All @@ -1302,7 +1302,7 @@ public float frechet_distance(Temporal other){
* @return A {@link Float} with the Dynamic Time Warp distance.
*/
public float dyntimewarp_distance(Temporal other){
return (float) GeneratedFunctions.temporal_dyntimewarp_distance(this.inner,other.getInner());
return (float) GeneratedFunctions.temporal_dyntimewarp_distance(this.inner,other.getInner(), true);
}

/**
Expand All @@ -1317,7 +1317,7 @@ public float dyntimewarp_distance(Temporal other){
* @return A {@link Float} with the Hausdorff distance.
*/
public float hausdorff_distance(Temporal other){
return (float) GeneratedFunctions.temporal_hausdorff_distance(this.inner,other.getInner());
return (float) GeneratedFunctions.temporal_hausdorff_distance(this.inner,other.getInner(), true);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void objectArgumentsMatchTheLibrary() {

// A temporal object argument is forwarded as its inner pointer.
assertEquals(id(GeneratedFunctions.temporal_merge(pa, b.getInner())), id(g.merge(b)));
assertEquals(GeneratedFunctions.temporal_frechet_distance(pa, b.getInner()), g.frechetDistance(b));
assertEquals(GeneratedFunctions.temporal_frechet_distance(pa, b.getInner(), true), g.frechetDistance(b, true));
assertEquals(id(GeneratedFunctions.temporal_insert(pa, b.getInner(), true)), id(g.insert(b, true)));
assertEquals(id(GeneratedFunctions.temporal_append_tsequence(pa, b.getInner(), false)),
id(g.appendTsequence(b, false)));
Expand Down Expand Up @@ -400,8 +400,8 @@ void similarityPathsMatchTheLibrary() {

// frechetPath folds the Match array into records; compare each to the raw {i, j} pair.
Pointer c = Memory.allocate(rt, Integer.BYTES);
Pointer arr = GeneratedFunctions.temporal_frechet_path(pa, b.getInner(), c);
List<GeneratedTemporal.Match> path = g.frechetPath(b);
Pointer arr = GeneratedFunctions.temporal_frechet_path(pa, b.getInner(), true, c);
List<GeneratedTemporal.Match> path = g.frechetPath(b, true);
assertEquals(c.getInt(0), path.size());
for (int i = 0; i < path.size(); i++) {
assertEquals(arr.getInt((long) i * 8), path.get(i).i());
Expand All @@ -410,8 +410,8 @@ void similarityPathsMatchTheLibrary() {

// The dynamic-time-warp path folds the same way.
Pointer c2 = Memory.allocate(rt, Integer.BYTES);
GeneratedFunctions.temporal_dyntimewarp_path(pa, b.getInner(), c2);
assertEquals(c2.getInt(0), g.dyntimewarpPath(b).size());
GeneratedFunctions.temporal_dyntimewarp_path(pa, b.getInner(), true, c2);
assertEquals(c2.getInt(0), g.dyntimewarpPath(b, true).size());
}

@Test
Expand Down
5 changes: 3 additions & 2 deletions tools/codegen_jvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,9 @@ def folded_nxn(r):
else:
periods = nm
i += 1; continue
if c in ('double', 'int'):
scalars.append((nm, 'double' if c == 'double' else 'int')); i += 1; continue
if c in ('double', 'int', 'bool'):
scalars.append((nm, {'double': 'double', 'int': 'int', 'bool': 'boolean'}[c]))
i += 1; continue
return None
if not arrays or count is None:
return None
Expand Down
Loading
Loading