Questions tagged [jscience]

JScience is a comprehensive Java library for scientific computing.

JScience is a comprehensive Java library for scientific computing. It provides strongly typed mathematical and physical structures, as well as efficient integer, rational, real and complex numbers types.

63 questions
1
vote
1 answer

How to install JScience library in Eclipse?

Or just any library, in general? I downloaded the bin.zip file, but I can't seem to do much with it? This is driving me up the wall... EDIT: In other words, there is no "standard" way to do it? I know how to add the Jar files, is it ok to just put…
Alexander
1
vote
1 answer

How do I create symbolic variables/functions involving vectors using JScience?

How do I create symbolic variables/functions involving vectors using JScience? Creating float variables is easy: Variable varX = Variable.local("x"); How can I do the same for a vector? Once I have a vector variable, how do I…
gdoug
  • 715
  • 1
  • 5
  • 16
1
vote
1 answer

Javax.measure.quantity.Duration conversion issue

I am using javax.measure to convert user input to seconds that can vary anywhere from seconds to days, however converting from any unit to another doesn't work, here is what I have set up. String units = "d"; double value = 30.0; BaseUnit
pianoisland
  • 163
  • 1
  • 1
  • 10
1
vote
1 answer

Strange Javax.measure.quantity.Length Bound Mismatch

I wrote some code using javax.measure, and when I pulled updated code from our repository, I am getting a Bound Mismatch error whenever I try to use from javax.measure. Edit The Exact Error Is: Bound mismatch: The type Length is not a…
pianoisland
  • 163
  • 1
  • 1
  • 10
1
vote
1 answer

How to get full unit name in jscience

I'm using jscience to parse some units for me: Unit meter = Unit.valueOf("m"); System.out.println(meter); Unit foot = Unit.valueOf("ft"); System.out.println(foot); This prints out : m ft I'd like it to print out metre…
Andy
  • 3,228
  • 8
  • 40
  • 65
1
vote
2 answers

How to ensure that a java class is loaded at application startup itself?

I have a class extending Jscience's SystemOfUnits to define some custom units. I want this class to be loaded by JVM even before any call to method Unit.valueOf() is invoked. if the class is not loaded in JVM then below invocation fails as…
Subhu.rys
  • 25
  • 1
  • 7
1
vote
1 answer

java.lang.NoClassDefFoundError: org.jscience.mathematics.function.Variable$Local

I have sample code downloaded from here for using jscience. But when I use it, it gives this message: E/AndroidRuntime(1296): java.lang.NoClassDefFoundError:org.jscience.mathematics.function.Variable$Local Am I missing something? Of course I…
max
  • 5,963
  • 12
  • 49
  • 80
1
vote
1 answer

Vector normalization in jscience.mathematics.vector

I have a Vector vec in jscience. I could not find the function to normalize it. Could you please help me to normalize vec?
padawan
  • 1,295
  • 1
  • 17
  • 45
1
vote
1 answer

jscience Real comparison returns false even though values are equal

Here is my code: Real AB = adj[a].get(b); System.out.println("AB " + AB); Real AC = adj[a].get(c); System.out.println("AC " + AC); Real BC = adj[b].get(c); System.out.println("BC " +…
padawan
  • 1,295
  • 1
  • 17
  • 45
1
vote
1 answer

Trilateration in 3-D Algorithm Returns NaN

I tried to code the steps provided in this article. public static double[] localize(final double[] P1, final double[] P2, final double[] P3, final double[] P4, final double r1, final double r2, final double r3, final double r4) { Point3d p1 =…
padawan
  • 1,295
  • 1
  • 17
  • 45
1
vote
2 answers

Using Jscience to compute price for n units provided unit price and quantity

I am looking for a better way to compute using Jscience but the generic pattern is much tougher to get a clear solution. I need to compute price for n units provided the unit price for a unit quantity is defined. like, Measure
Subhu.rys
  • 25
  • 1
  • 7
1
vote
1 answer

LargeInteger's equivalent of BigInteger's testBit?

Does LargeInteger have an equivalent to BigInteger's testBit? If not, how can testBit be performed on a LargeInteger? I don't yet have the necessary skills to reproduce ((this & (1<
user1382306
1
vote
1 answer

Output units without multiply character?

I am using the awesome JScience library to convert units. What is bothering me: The output of for example WATT.times(HOUR) is W·h. What I want to output is just Wh. Is it possible to change the output for all units without implementing an own…
Stephan
  • 4,395
  • 3
  • 26
  • 49
1
vote
4 answers

Java methods that look like: public static > DenseVector valueOf(F... elements)...what are they?

So, I'm looking through a java library (JScience) after someone here thoughfully pointed me towards it for getting Vectors (mathematical ones, that is) in java. Unfortunately, I've never seen anything in my life before like: public static
J.R.
  • 5,789
  • 11
  • 55
  • 78
1
vote
1 answer

Matrix.solve() gives different answer with RationalFunction than with Rational

I'm using the Jscience linear algebra module to solve a linear system of rational numbers. This works as expected and gives the correct result: public static void main(String[] args) { DenseMatrix m = DenseMatrix.valueOf( …
Feuermurmel
  • 9,490
  • 10
  • 60
  • 90