Bspline

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file lib/bspline. To experiment with that code, run bin/console for an interactive prompt.

Revision history

3.0.0 Upload for test
3.0.1 Upload for release
3.0.2 Add method with keyword arguments

Installation

Add this line to your application's Gemfile:

gem 'bspline'

And then execute:

$ bundle

Or install it yourself as:

$ gem install bspline

Usage

1. summary

Bspline interpolation - Ruby libraly

2. usage in ruby script file

require 'bspline'
include BSPLINE

obj = Bspline.new(..)
..

3. class

Module 'BSPLINE' has 3 classes.

3.1 Basic interpolation without boundary condition

BSPLINE::Bspline.new([[x1,y1],..,[xn,yn]], j)

3.2 Interpolation with boundary condition by additional data points

BSPLINE::Bspline.new([[x1,y1],..,[xn,yn]], j, [[xn+1,yn+1],..,[xn+d,yn+d]])

3.3 Interpolation with boundary condition by differential value

BSPLINE::Bspline.new([[x1,y1],..,[xn,yn]], j, [[xn+1,yn+1],..,[xn+d,yn+d]], [b1,..,bd])

3.4 Interpolation with period boundary condition

BSPLINE::Tspline.new([[x0,y0],..,[xn,yn]], j)

3.5 Interpolation of smoothing spline

BSPLINE::Gspline.new([[x0,y0],..,[xn,yn]], j, g)

4. Calculate interporation

4.1 Calculate interpolation

self[x] #=> y   
self[x1,...,xi] #=> [y1,...yi]

4.2 Calculate interpolation with differential value

self.value(x, b = 0)

4.3 Calculate interpolation with integrated value

self.sekibun(x)

4.4 calculate an interpolation for graphs

self.plot([x0,...,xn], d, b = 0) { |x,y| ... }

See example/*.rb

5. Bspline object defined with keyword arguments

5.1 Basic interpolation without boundary condition

[[x1,y1],..,[xn,yn]].bspline(order: j)

5.2 Interpolation with boundary condition by additional data points

[[x1,y1],..,[xn,yn]].bspline(order: j, condition: [[xn+1,yn+1],..,[xn+d,yn+d]])

5.3 Interpolation with boundary condition by differential value

[[x1,y1],..,[xn,yn]].bspline(order: j, condition: [[xn+1,yn+1],..,[xn+d,yn+d]], differential_order: [b1,..,bd])

5.4 Interpolation with period boundary condition

[[x0,y0],..,[xn,yn]].tspline(order: j)

5.5 Interpolation of smoothing spline

[[x0,y0],..,[xn,yn]].gspline(order: j, smoothing_factor: g)

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/vsp2old/bspline.