Click here to Skip to main content
15,893,401 members
Articles / Programming Languages / Visual Basic

Mathemathics Framework

Rate me:
Please Sign up or sign in to vote.
4.76/5 (56 votes)
16 Sep 2008CPOL6 min read 75.4K   6.2K   171  
.NET Mathematical Framework
Imports BV.Core
Imports BV.Math
Imports IMidRange
Imports System.Drawing





'Calc
'29/7/04
Public Class ParallelSystemCalc
    Inherits BasicSystemCalc

    Public Sub New(ByVal fn As ICalcU)
        MyBase.New(fn)
    End Sub

    Public ReadOnly Property DataCount() As Long
        Get
            Return intdata.GetUpperBound(0)
        End Get
    End Property

#Region "In Methods"

    Public Overrides Function [In](ByVal o As Object) As Boolean
        If TypeOf o Is Single() Then
            InputParallel(CType(o, Single()))
        ElseIf TypeOf o Is PointF() Then
            InputParallel(CType(o, PointF()))
        ElseIf TypeOf o Is PointC() Then
            InputParallel(CType(o, PointC()))
        Else
            If MessageManager.Send(Me, New MessageEventArgs("Unsuported Input Type", MessageEventArgs.EMessageType.Error)) Then
                Stop
            End If
            Exit Function
        End If
        RaiseDataChanged(Me, New EventArgs)
    End Function

    Protected Overridable Sub InputParallel(ByVal s() As Single)
        Dim i As Integer
        Dim PC() As PointF

        ReDim PC(s.GetUpperBound(0))
        Do While i < s.GetUpperBound(0)
            PC(i) = New PointF(i, s(i))
            i = i + 1
        Loop
        intdata = PC
    End Sub

    Protected Overridable Sub InputParallel(ByVal c() As ComplexUndefinied)  'Implements IInputCalcCU.In
        Me.intdata = c
    End Sub

    Protected Overridable Sub InputParallel(ByVal p() As PointF)  'Implements IInputCalcXY.In
        Me.intdata = p
    End Sub

    Protected Overridable Sub InputParallel(ByVal PC() As PointC)  'Implements IInputParallelXY.In
        Me.intdata = PC
    End Sub

#End Region


End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Engineer Universidad Tecnológica Nacional
Argentina Argentina
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions