score:2
you can only call the method cumulativeprobability
on an instance of class normaldistribution
.
so, you will first have to create a normaldistribution
object, and then call the method on that object. something like this:
val distr = new normaldistribution()
val prob = distr.cumulativeprobability(b)
i don't know what you mean by the new
in this line:
val x = new (1 - cumulativeprobability(b))
but that's not valid syntax. you use the new
operator to create a new object - i don't know what your intention was here.
score:1
first you need to make sure that the dependency is available to the project.
if for example your project is sbt-based, see http://www.scala-sbt.org/0.13/docs/library-management.html, if you use maven the story is pretty much the same.
once you update your project definition, you need to recreate project files for your intellij, i think you can use sbt-idea for sbt, and finally reimport the project. the support for maven should be integrated instead.
if you created your project directly in intellij without relying on these two then you need to add the jar dependency to your build path, see https://confluence.jetbrains.com/display/intellijidea/dependencies+management+%28build+path%29.
if the configuration is correct then you will see no red squiggle under the import statement for the library.
about the snippet, you should check what can you actually do with normaldistribution
by checking the javadoc for it, i read you have some different constructors, by which you can configure your instance, for example setting a random generator explicitly.
when you get the instance you can call all of the public instance methods on it.
Source: stackoverflow.com
Related Query
- Import external library in Scala
- Import Java library to Scala sbt project
- Scala play!2 create Json formatter for a class in external library
- How to import TwitterUtils library from scala
- How to detect import of a certain library in Scala
- Automatically convert scala import sentences into library dependencies
- EMR Notebook Scala kernel import graphframes library
- Why Scala playframework doesn't import library
- Import a Scala library with the jvmr Scala interpreter in R
- Scala IntelliJ library import errors
- scala import library wildcard
- Import Jar Library from Classpath in Scala
- Scala Reflection Instantiating class issues with embded external library in this spark schema structs
- error to import graphx library in scala project
- Is the Scala 2.8 collections library a case of "the longest suicide note in history"?
- Simple and concise HTTP client library for Scala
- How does the Cats library in Scala relate to scalaz?
- Scala import not working - object <name> is not a member of package, sbt preppends current package namespace in imports
- Typesafe config: Load additional config from path external to packaged scala application
- Scala library to convert numbers (Int, Long, Double) to/from Array[Byte]
- Error: scala: No 'scala-library*.jar' in Scala compiler library
- How to support multiple Scala versions in a library
- Does Scala have a library method to build Option-s that takes into account empty strings?
- Using a Java library with Scala reserved words
- Recommended Scala io library
- graph library for scala
- Scala streaming library differences (Reactive Streams/Iteratee/RxScala/Scalaz...)
- IntelliJ 14 - Create / Import a Scala / SBT project
- Missing import scala.collection.parallel in Scala 2.13
- Why does the Scala library only defines tuples up to Tuple22?
More Query from same tag
- scala protected modifier convert to java class is public
- How to recognize scala constructor parameter 'fields' with no underlying java field?
- New behavior in Scala 2.10
- Requirement failed: Reordering broke - Spark Cassandra
- Scala - looping over case class names to use as type parameters
- Scala, ZIO - log something after every retry
- How to pattern match using regular expression in Scala?
- Extract value from Option of List
- Implementing List#flatMap
- Scala function which extracts Class[_] out of generic
- How do you submit a job to Spark from code?
- How do I find the absolute path to a Play Framework app?
- Error while using "newAPIHadoopFile" API
- Using Scala Actors to create sth like a Pipeline
- High-order function or just object method access?
- How do I do casting in Scala?
- Returning true if all items in a list are true, otherwise false
- Error creating repository bean with Spring
- How can I negate "inSet" in a Scala Slick query?
- How to use cookie and BASIC authentication together?
- Java Apache Math3 MersenneTwister VS Python random
- Why aren't my scala futures more efficient?
- How to add custom directory to Scala SBT project?
- How to practicaly handle List[FieldError] in Lift with Squeryl
- scala : continue processing on exception
- scala play 2.0 get request header
- Return generic superclass from a function instead of subclass
- Scala: can PriorityQueue.update be used efficiently to decrease keys?
- Extracting Path Head in Akka Directives
- Scala Error:Type Arguments