GithubHelp home page GithubHelp logo

yudhastyawan / angka Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 9.32 MB

a repository focusing on the data processing package namely angka

License: MIT License

C 63.40% Makefile 0.99% SWIG 5.55% Python 29.43% Starlark 0.20% CMake 0.44%

angka's Introduction

Angka

Documentation Status PyPI version GitHub issues GitHub forks GitHub stars GitHub license

a repository focusing on data processing package namely angka. It focuses on matrix data manipulating and visualization in C. The project is an initial step for the applied focuses, especially earth science purposes. We also have a goal to wrap this library to another language such as Python.

The important links

Python examples

Example 1:

>>> from angka import *
# create and set the size of vector
>>> vec = AgxVector(10)
# change the value of each element to be a random value
>>> vec.random(-15,15)
>>> print(vec)
10 [14.45432, -9.45448, 5.05157, -6.45054,..., 13.44721]

# force to change all element to be a value.
>>> vec <<= 4.
>>> print(vec) 
10 [4.00000, 4.00000, 4.00000, 4.00000,..., 4.00000]

Example 2:

>>> from angka import * 
>>> vec = AgxVector(8)  
>>> vec.random(-15,15)  
>>> print(vec)          
8 [14.78667, 2.83684, -9.52864, 8.94909,..., -9.82345]

# we can change all element in existing vector and create linspace
>>> vec.linspace(0., 15.)
>>> print(vec)
8 [0.00000, 1.87500, 3.75000, 5.62500,..., 13.12500]

# append a value in the end of vector
>>> vec.append(10.)
>>> print(vec)      
9 [0.00000, 1.87500, 3.75000, 5.62500,..., 10.00000]

# copy vector
>>> vec2 = vec.copy()
>>> vec2.random(-12,4)
>>> print(vec2)
9 [0.78505, -10.04876, -4.48951, -8.66396,..., 2.14642]

# using built-in len() python
>>> len(vec2)
9

# create a new vector based on an existing vector changed by a value.
>>> vec3 = vec2 << 5.
>>> print(vec3)
9 [5.00000, 5.00000, 5.00000, 5.00000,..., 5.00000]

# vector added by a value
>>> vec4 = vec3 + 5  
>>> print(vec4)     
9 [10.00000, 10.00000, 10.00000, 10.00000,..., 10.00000]

# built-in in
>>> 10. in vec4 
True
>>> 8. in vec4  
False

# iteration using for ... in ...
>>> for x in vec2:
...     print(x)
... 
0.7850581377605526
-10.048768578142644
-4.489516891994995
-8.663960692159794
3.3110141300698874
-5.852351451155125
2.0018921475875118
-8.59706411938841
2.146427808465834

# print all elements in the vector
>>> vec2.printFull()
9 [0.78505, -10.04876, -4.48951, -8.66396, 3.31101, -5.85235, 2.00189, -8.59706, 2.14642]

Example 3:

>>> import numpy as np
>>> npa = np.array([1,2,3]) 

# numpy to vector
>>> vec = AgxVector(npa)
>>> print(vec)
3 [1.00000, 2.00000, 3.00000]

# vector to numpy
>>> vec.toNumpy()
array([1., 2., 3.])

angka's People

Contributors

putupradnya avatar yudhastyawan avatar

Stargazers

 avatar

Watchers

 avatar  avatar

angka's Issues

create a matrix slice

Like in Python, we can discuss how in a better way to create a slice matrix. We can provide 2 outputs, such as matrix and vector.
The first thing, we can create struct slice with int start, stop, step.

Integrated to the web app aplication

The options are:

  • we can create the other main folder to be the main project of this feature, or
  • we can create the other repository, but for the initialization, we can use this repository for enhancing the first step.

The purposes are:

  • to do the matrix and vector operations on the web, and
  • management data in the server.

the naming convention in our C library program

We can use camelCase type for better reading. The other characteristics are:

  • the function should be started by 'get' and then the name of function like getMatrixNew(int row, int col).
  • the data type should be following the camel type like matrix or vector, and if we have more than one word, we can do like this: vectorString or matrixString.
  • We can use void or void * for describing that this function is not a return-type.
  • The important thing is if we create a function that the return is matrix * or vector * or the other data type that creating dynamical memory, we need to tell the users to use getMatrixDelete() or the other similar case to make sure that the allocated memory has been deleted.

Adding matrix operation functions

Including:

  • multiplication
  • inversion
  • etc, (please Putu and Asido to add the other features to this list; for remembering the priority of matrix operations)

is creating data visualization in C possible?

that's a good idea to enhance the C programming language so that we can purely doing some kinds of stuff in C, not the other language.
The things that I have been thinking are:

  • Using Cairo API to create a visualization (this is what matplotlib used in the first step)
  • Using GUI API to create a window (like GTK+ or wxwidgets (but this is C++?)
  • or integrated to web API to do the visualization (@putupradnya, that is interesting)

@putupradnya or @asidosaputra, you can give your opinion about this insight, see you in the comments.

wrapping in Python

The purpose is that we can link or wrap this API to Python for better handling.

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.