Sha256: 40a246decff428fceeecd630e150bc0c27dc07bc3ae8d453f43c521f0d8ba0c1

Contents?: true

Size: 1.96 KB

Versions: 5

Compression:

Stored size: 1.96 KB

Contents

# -*- coding: utf-8 -*-

##########################################################################################
# Copyright © 2013 Rodrigo Botafogo. All Rights Reserved. Permission to use, copy, modify, 
# and distribute this software and its documentation, without fee and without a signed 
# licensing agreement, is hereby granted, provided that the above copyright notice, this 
# paragraph and the following two paragraphs appear in all copies, modifications, and 
# distributions.
#
# IN NO EVENT SHALL RODRIGO BOTAFOGO BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, 
# INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF 
# THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RODRIGO BOTAFOGO HAS BEEN ADVISED OF THE 
# POSSIBILITY OF SUCH DAMAGE.
#
# RODRIGO BOTAFOGO SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE 
# SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS". 
# RODRIGO BOTAFOGO HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, 
# OR MODIFICATIONS.
##########################################################################################

require 'rubygems'
require "test/unit"
require 'shoulda'

require 'mdarray'

class MDArrayTest < Test::Unit::TestCase

  context "Trigonometric Tests" do

    setup do

      @a = MDArray.typed_arange("double", 90)

      # create double array
      @b = MDArray.double([2, 3, 4])

      @c = MDArray.linspace("double", 0, 1, 100)

    end

    #-------------------------------------------------------------------------------------
    #
    #-------------------------------------------------------------------------------------

    should "execute trigonometric functions" do


      sin = @a.sin
      sin.print

      cos = @a.cos

      id = sin**2 + cos**2
      assert_equal(1, id)

      sec = 1 / @a.cos

    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mdarray-0.5.5.2-java test/mdarray/test_trigonometry.rb
mdarray-0.5.5.1-java test/mdarray/test_trigonometry.rb
mdarray-0.5.5-java test/mdarray/test_trigonometry.rb
mdarray-0.5.4-java test/mdarray/test_trigonometry.rb
mdarray-0.5.3-java test/mdarray/test_trigonometry.rb