Code Monkey home page Code Monkey logo

coremath's Introduction

Hey, Paul here! ๐Ÿ‘‹

Some facts about me:

  • Studying at Technical University Munich (Informatics M.Sc.) ๐ŸŽ“
  • Working at QuickBird as Software Engineer ๐Ÿ‘จ๐Ÿผโ€๐Ÿ’ป
  • Constantly learning, developing, trying out new things and finding better ways to solve problems ๐ŸŒฑ

coremath's People

Contributors

pauljohanneskraft avatar pauljohanneskraft-zz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

adamnemecek

coremath's Issues

Universal Function System

a mathematical equivalent to equations
--> because Polynomial doesn't allow to model log(x), sin(x), etc

struct Equation having an array of Terms
Term is a struct containing a description and a function calculating the result

testing on linux currently missing

Currently Travis-CI only builds Math on Linux without running the test suite.
As no code is run in the current scenario, it cannot be assured, that the code really runs correctly on Linux.
As the source code is the same and it should run the same way on Linux as on OS X, this has low/zero priority.

tests can't use custom operators

This may be a Swift error due to its "beta" status.
Operators declared in the project can't be used in test functions due to "ambigous operator"-errors.
Some operators work, some don't.
Already importing project using "@testable import Math".
Error shows definition in the project, as well as where it is used...

combine / decide on Polynomial type

_Polynomial and Polynomial somehow need to be combined in the function system

--> adding polynomial division in Fraction.reduced
--> maybe some function to test if equation is "pure" polynomial?

Type-checking error in Linux tests

Travis builds on Linux throw this mysterious error, somehow connected to type checking
(surprisingly only one test method fails (addition, subtraction, division seem to be fine...))

#0 0x000000000334a5b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0x334a5b8)
#1 0x0000000003348d86 llvm::sys::RunSignalHandlers() (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0x3348d86)
#2 0x000000000334b0ea SignalHandler(int) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0x334b0ea)
#3 0x00007ffb823fc330 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x0000000000fe443b swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe443b)
#5 0x0000000000fe255f swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe255f)
#6 0x0000000000fe6afd swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe6afd)
#7 0x0000000000fe1b73 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe1b73)
#8 0x0000000000fe6afd swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe6afd)
#9 0x0000000000fe255f swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe255f)
#10 0x0000000000fe6afd swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe6afd)
#11 0x0000000000fe1b73 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe1b73)
#12 0x0000000000fe6afd swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe6afd)
#13 0x0000000000fe1b73 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe1b73)
#14 0x0000000000fe81ef swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe81ef)
#15 0x0000000000fe1b73 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe1b73)
#16 0x0000000000fe81ef swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe81ef)
#17 0x0000000000fe255f swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe255f)
#18 0x0000000000fe6afd swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe6afd)
#19 0x0000000000fe1b73 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe1b73)
#20 0x0000000000fe1609 swift::constraints::ConstraintSystem::solve(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe1609)
#21 0x0000000000fe425a swift::constraints::ConstraintSystem::solve(swift::Expr*&, swift::Type, swift::ExprTypeCheckListener*, llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xfe425a)
#22 0x0000000000ec1843 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImplswift::constraints::Solution&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xec1843)
#23 0x0000000000ec4e3d swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xec4e3d)
#24 0x0000000000f47b50 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xf47b50)
#25 0x0000000000f466c5 (anonymous namespace)::StmtChecker::typeCheckBody(swift::BraceStmt*&) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xf466c5)
#26 0x0000000000f4591a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xf4591a)
#27 0x0000000000f4577e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xf4577e)
#28 0x0000000000f46343 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xf46343)
#29 0x0000000000eff276 typeCheckFunctionsAndExternalDecls(swift::TypeChecker&) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xeff276)
#30 0x0000000000effda1 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xeffda1)
#31 0x0000000000c8065b swift::CompilerInstance::performSema() (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0xc8065b)
#32 0x00000000007ddce0 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0x7ddce0)
#33 0x00000000007dcc57 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0x7dcc57)
#34 0x00000000007a8718 main (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0x7a8718)
#35 0x00007ffb80ba5f45 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21f45)
#36 0x00000000007a6116 _start (/home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift+0x7a6116)
Stack dump:
0. Program arguments: /home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift -frontend -c /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/_PolynomialTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/TrigonometricFunctionTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/ConstantsTest.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/GrowthTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/RingTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/CustomFunctionTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/BasicArithmeticTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/ComplexTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/TeXTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/GroupTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/AdvancedNumericTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/MatrixTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/PolynomialFunctionTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/EquationTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/ConstantFunctionTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/EnhancedNumberTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/TermTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/DataTypeTest.swift -primary-file /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/RationalNumberTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/ModuleTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/NumericTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/FractionTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/PolynomialTests.swift /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/LinuxCompatibilityTests.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -I /home/travis/build/pauljohanneskraft/Math/.build/debug -enable-testing -g -module-cache-path /home/travis/build/pauljohanneskraft/Math/.build/debug/ModuleCache -D SWIFT_PACKAGE -emit-module-doc-path /home/travis/build/pauljohanneskraft/Math/.build/debug/MathTests.build/RationalNumberTestspartial.swiftdoc -Onone -parse-as-library -module-name MathTests -emit-module-path /home/travis/build/pauljohanneskraft/Math/.build/debug/MathTests.build/RationalNumberTestspartial.swiftmodule -emit-dependencies-path /home/travis/build/pauljohanneskraft/Math/.build/debug/MathTests.build/RationalNumberTests.d -emit-reference-dependencies-path /home/travis/build/pauljohanneskraft/Math/.build/debug/MathTests.build/RationalNumberTests.swiftdeps -num-threads 8 -o /home/travis/build/pauljohanneskraft/Math/.build/debug/MathTests.build/RationalNumberTests.swift.o

  1. While type-checking 'testMultiplication' at /home/travis/build/pauljohanneskraft/Math/Tests/MathTests/RationalNumberTests.swift:26:2
  2. While type-checking expression at [/home/travis/build/pauljohanneskraft/Math/Tests/MathTests/RationalNumberTests.swift:27:3 - line:27:104] RangeText="forAll("*", assert: { a,b,c in return ((a.double * b.double) - (c.double)).abs < 1e-10 } ) { $0 * $1 }"
    :0: error: unable to execute command: Segmentation fault
    :0: error: compile command failed due to signal (use -v to see invocation)
    :0: error: build had 1 command failures
    error: exit(1): /home/travis/build/pauljohanneskraft/Math/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift-build-tool -f /home/travis/build/pauljohanneskraft/Math/.build/debug.yaml test

Combining Exponential & Polynomial

As Exponential is a more general way to think about a Polynomial, this could actually be merged into one type...

A more in-depth look at calculus of a^b is needed.

adding growth class to Function

maybe through some property like:

protocol Function {
// ...
var growthClass : GrowthClass { get }
}

// not static, because e.g. Polynomial has a variable exponent

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.