Code Monkey home page Code Monkey logo

array-operations's Introduction

Contributors Forks Stargazers Issues MS-PL License LinkedIn


Logo

Lisp-Stat

An environment for statistical computing
Explore the docs »

Report Bug · Request Feature · Reference Manual

Table of Contents

  1. About the Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Resources
  6. Contributing
  7. License
  8. Contact

About the Project

Lisp-Stat provides support for vectorized mathematical operations, and a comprehensive set of statistical methods that are implemented using the latest numerical algorithms. In addition, Common Lisp provides a dynamic programming environment (REPL), an excellent object-oriented facility (CLOS) and meta-object protocol (MOP).

Lisp-Stat is fully functional today, and most of the XLISP-STAT libraries can be ported with the aid of a compatibility package XLS-compat. This gives Lisp-Stat a leg up on ecosystem development.

Built With

Getting Started

To get a local copy up and running follow these steps:

Prerequisites

An ANSI Common Lisp implementation. Developed and tested with SBCL and CCL.

Note: CCL is in poor condition these days, and we no can longer support it due to some serious problem with numerical accuracy. See issue 390 for just one of the problems. A shame, because it's a great environment to work in.

Installation

Lisp-Stat is composed of several systems that are designed to be independently useful. So you can, for example, use select to obtain selections from two dimensional arrays without bringing in all of Lisp-Stat.

The easy way

Quicklisp has many dependencies, and the easiest way to load it is with a package manager, such as Quicklisp or CLPM. The install is a one-liner:

(clpm-client:sync :sources "clpi") ;sources may vary
(ql:quickload :lisp-stat)

From source

To make the system accessible to ASDF (a build facility, similar to make in the C world), clone the repository in a directory ASDF knows about. By default the common-lisp directory in your home directory is known. Create this if it doesn't already exist and then:

  1. Clone the repositories
cd ~/common-lisp && \
git clone https://github.com/Lisp-Stat/data-frame.git && \
git clone https://github.com/Lisp-Stat/dfio.git && \
git clone https://github.com/Lisp-Stat/special-functions.git && \
git clone https://github.com/Lisp-Stat/numerical-utilities.git && \
git clone https://github.com/Lisp-Stat/array-operations.git && \
git clone https://github.com/Lisp-Stat/documentation.git && \
git clone https://github.com/Lisp-Stat/distributions.git && \
git clone https://github.com/Lisp-Stat/plot.git && \
git clone https://github.com/Lisp-Stat/select.git && \
git clone https://github.com/Lisp-Stat/cephes.cl.git && \
git clone https://github.com/Symbolics/alexandria-plus && \
git clone https://github.com/Lisp-Stat/statistics.git && \
git clone https://github.com/Lisp-Stat/lla.git && \
git clone https://github.com/Lisp-Stat/smoothers && \
git clone https://github.com/Lisp-Stat/lisp-stat.git
  1. Reset the ASDF source-registry to find the new system (from the REPL)
    (asdf:clear-source-registry)
  2. Load the system
    (asdf:load-system :lisp-stat)

If you have installed the slime ASDF extensions, you can invoke this with a comma (',') from the slime REPL.

You'll need to use Quicklisp, CLPM or manually obtain the remaining third-party dependencies.

Running Tests

To run the lisp-stat tests, evaluate this form: (asdf:test-system :lisp-stat)

Usage

Create a data frame from a file named sg-weather.csv on the local disk:

(defparameter *df*
	(read-csv #P"LS:DATA;sg-weather.csv"))

For more examples, please refer to the Documentation.

Roadmap

See the open issues for a list of proposed features (and known issues).

Resources

This system is part of the Lisp-Stat project; that should be your first stop for information. Also see the community page for more information.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated. Please see CONTRIBUTING for details on the code of conduct, and the process for submitting pull requests.

License

Distributed under the MS-PL License. See LICENSE for more information.

Contact

Project Link: https://github.com/lisp-stat/lisp-stat

array-operations's People

Contributors

bendudson avatar mistransky avatar phoe avatar slids avatar subordinalblue avatar tpapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

bpecsek kilianmh

array-operations's Issues

Tests generate "deleting unreachable code" note in SBCL

SBCL prints this note in 12 tests. A macro expansion shows that everything looks OK, and the tests appear to run (by the counts returned from CLUNIT), but it would be nice to fix this.

This might be a bug in SBCL, as there are several levels of macro expansion here, or it may be a problem with the tests. One clue is that they are all generated from indexing functions.

Interested by those map-array macros?

Made these "proper" macros that mimic the sequence map because I didn't like vectorize's need for symbols.

(defmacro map-array-into (dest fun &rest arrays)
  "map for arrays. Only the arrays' total-size must be equal."
  (assert arrays () "map-array-into needs at least one array argument")
  (let ((array-num (length arrays)))
    (once-only (dest (arrays ``(,,@arrays)))
      `(iter
         (initially (assert (apply #'= (array-total-size ,dest) (mapcar #'array-total-size ,arrays))
                            () "map-array-into array arguments must have the same total size"))
         (for i below (array-total-size (car ,arrays)))
         (with arrays-vec = (coerce ,arrays 'vector))
         (setf (row-major-aref ,dest i)
               (funcall ,fun
                        ,@(iter (for i below array-num)
                            (collect `(row-major-aref (aref arrays-vec ,i) i)))))
         (finally (return ,dest))))))

(defmacro map-array (fun &rest arrays)
  "map for arrays. Only the arrays' total-size must be equal.
The resulting array uses the dimensions of the first array parameter."
  (assert arrays () "map-array needs at least one array argument")
  (let ((array-num (length arrays)))
    (once-only ((arrays ``(,,@arrays)))
      `(iter
         (initially (assert (apply #'= (mapcar #'array-total-size ,arrays))
                            () "map-array array arguments must have the same total size"))
         (with ret = (make-array (array-dimensions (car ,arrays))))
         (for i below (array-total-size (car ,arrays)))
         (with arrays-vec = (coerce ,arrays 'vector))
         (setf (row-major-aref ret i)
               (funcall ,fun
                        ,@(iter (for i below array-num)
                            (collect `(row-major-aref (aref arrays-vec ,i) i)))))
         (finally (return ret))))))

would you be interested? If so, I'd convert iter to loop and make a PR. I also plan on making an array version for all the relevant sequence functions (substitute, count, find, position, replace, fill, etc...).

Licensing of this fork

MIT license states:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

0b9c45b removes the "copyright notice" that the above portion of MIT license talks about. f63ae44 removes the MIT license text altogether, which means that the "permission notice" is not included either.

Isn't that a full-on license breach?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.