{"id":25456841,"url":"https://github.com/szaghi/vecfor","last_synced_at":"2026-02-28T11:45:12.318Z","repository":{"id":43113316,"uuid":"45450491","full_name":"szaghi/VecFor","owner":"szaghi","description":"Vector algebra class for Fortran poor people","archived":false,"fork":false,"pushed_at":"2022-07-06T08:51:57.000Z","size":6855,"stargazers_count":28,"open_issues_count":2,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-10-14T08:39:06.824Z","etag":null,"topics":["fortran","oop","vector","vector-algebra"],"latest_commit_sha":null,"homepage":null,"language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/szaghi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.bsd-2.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-03T07:53:58.000Z","updated_at":"2025-05-28T04:37:52.000Z","dependencies_parsed_at":"2022-09-22T06:00:54.562Z","dependency_job_id":null,"html_url":"https://github.com/szaghi/VecFor","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/szaghi/VecFor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szaghi%2FVecFor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szaghi%2FVecFor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szaghi%2FVecFor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szaghi%2FVecFor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/szaghi","download_url":"https://codeload.github.com/szaghi/VecFor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szaghi%2FVecFor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018301,"owners_count":26086344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fortran","oop","vector","vector-algebra"],"created_at":"2025-02-18T01:51:27.974Z","updated_at":"2025-10-14T08:39:11.083Z","avatar_url":"https://github.com/szaghi.png","language":"Fortran","readme":"\u003ca name=\"top\"\u003e\u003c/a\u003e\n\n# VecFor [![GitHub tag](https://img.shields.io/github/tag/szaghi/VecFor.svg)](https://github.com/szaghi/VecFor/releases) [![Join the chat at https://gitter.im/szaghi/VecFor](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/szaghi/VecFor?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n[![License](https://img.shields.io/badge/license-GNU%20GeneraL%20Public%20License%20v3,%20GPLv3-blue.svg)]()\n[![License](https://img.shields.io/badge/license-BSD2-red.svg)]()\n[![License](https://img.shields.io/badge/license-BSD3-red.svg)]()\n[![License](https://img.shields.io/badge/license-MIT-red.svg)]()\n\n[![Status](https://img.shields.io/badge/status-stable-brightgreen.svg)]()\n[![CI Status](https://github.com/szaghi/VecFor/actions/workflows/ci.yml/badge.svg)](https://github.com/szaghi/VecFor/actions)\n[![Coverage Status](https://img.shields.io/codecov/c/github/szaghi/VecFor.svg)](https://app.codecov.io/gh/szaghi/VecFor)\n\n### VecFor, Vector algebra class for Fortran poor people\n\nA KISS pure Fortran OOD class for computing Vectorial (3D) algebra\n\n- VecFor is a pure Fortran (KISS) library for building easily nice Command Line Interfaces (CLI) for modern Fortran projects;\n- VecFor is Fortran 2003+ standard compliant;\n- VecFor is OOP designed;\n- VecFor is a Free, Open Source Project.\n\n#### Table of Contents\n\n- [What is VecFor?](#what-is-vecfor)\n- [Main features](#main-features)\n- [Copyrights](#copyrights)\n- [Documentation](#documentation)\n  - [A Taste of VecFor](#a-taste-of-vecfor)\n\n#### Issues\n\n[![GitHub issues](https://img.shields.io/github/issues/szaghi/VecFor.svg)]()\n\n#### Compiler Support\n\n[![Compiler](https://img.shields.io/badge/GNU-v4.9.2+-brightgreen.svg)]()\n[![Compiler](https://img.shields.io/badge/Intel-v12.x+-brightgreen.svg)]()\n[![Compiler](https://img.shields.io/badge/IBM%20XL-not%20tested-yellow.svg)]()\n[![Compiler](https://img.shields.io/badge/g95-not%20tested-yellow.svg)]()\n[![Compiler](https://img.shields.io/badge/NAG-not%20tested-yellow.svg)]()\n[![Compiler](https://img.shields.io/badge/PGI-not%20tested-yellow.svg)]()\n\n## What is VecFor?\n\nVecFor is a user-friendly and Object-Oriented designed API for handling *vectors* in a (3D) three dimensional frame of reference. It exposes (among others) the *object* **Vector** that posses a far complete set of overloaded operators for performing vectorial calculus algebra.\n\nVecFor adheres to the [KISS](https://en.wikipedia.org/wiki/KISS_principle) concept: it is a pure Fortran (2003+) library coded into a single module file, `vecfor.F90`.\n\nGo to [Top](#top)\n\n## Main features\n\n+ [x] Pure Fortran implementation;\n+ [x] KISS and user-friendly:\n    + [x] simple API (one main *object* plus few other *helpers*);\n    + [x] easy building and porting on heterogeneous architectures:\n        + [x] the vector components are defined as real with parametrized kind; the default kind parameter is set to be 64-bit-like finite precision (defined by means of the portable `select_real_kind` intrinsic function), but it can be easily changed at compile time;\n+ [x] comprehensive (almost complete set of operators for vectorial calculus algebra);\n    + [x] all operators accept mixed type/kind arguments: vectors can be mixed with integers and reals of any kinds by means of generic interfaces with dynamic dispatch resolved at compile time;\n+ [x] efficient and *non intrusive* (all object methods and operators are *pure* or *elemental*):\n    + [x] threads/processes safe;\n+ [x] Tests-Driven Developed ([TDD](https://en.wikipedia.org/wiki/Test-driven_development));\n+ [x] well documented:\n    + [x] complete [API](http://szaghi.github.io/VecFor/index.html) reference;\n    + [x] comprehensive [wiki](https://github.com/szaghi/VecFor/wiki):\n+ [x] collaborative developed on [GitHub](https://github.com/szaghi/VecFor);\n+ [x] [FOSS licensed](https://github.com/szaghi/VecFor/wiki/Copyrights);\n\nAny feature request is welcome.\n\nGo to [Top](#top)\n\n## Copyrights\n\nVecFor is an open source project, it is distributed under a multi-licensing system:\n\n+ for FOSS projects:\n  - [GPL v3](http://www.gnu.org/licenses/gpl-3.0.html);\n+ for closed source/commercial projects:\n  - [BSD 2-Clause](http://opensource.org/licenses/BSD-2-Clause);\n  - [BSD 3-Clause](http://opensource.org/licenses/BSD-3-Clause);\n  - [MIT](http://opensource.org/licenses/MIT).\n\nAnyone is interest to use, to develop or to contribute to VecFor is welcome, feel free to select the license that best matches your soul!\n\nMore details can be found on [wiki](https://github.com/szaghi/VecFor/wiki/Copyrights).\n\nGo to [Top](#top)\n\n## Documentation\n\nBesides this README file the VecFor documentation is contained into its own [wiki](https://github.com/szaghi/VecFor/wiki). Detailed documentation of the API is contained into the [GitHub Pages](http://szaghi.github.io/VecFor/index.html) that can also be created locally by means of [ford tool](https://github.com/cmacmackin/ford).\n\n### A Taste of VecFor\n\nVecFor allows a very simple, high-level implementation of vectorial calculus algebra.\n\n#### Import VecFor\n\n```fortran\nuse vecfor ! load vector type and all helpers\n```\n\n#### Define some vector variables\n\n```fortran\ntype(vector) :: point1\ntype(vector) :: point2\ntype(vector) :: distance\n```\n\n#### Initialize vectors by high-level math-like syntax\n```fortran\npoint1 = 1 * ex ! ex is the versor along x direction exposed by VecFor\npoint2 = 1 * ex + 2 * ey ! ey is the versor along y direction exposed by VecFor\n```\nNote that *ex*, *ey* and *ez* are the Cartesian versors exposed by VecFor.\n\n#### Perform vectorial calculus algebra\n```fortran\ndistance = point2 - point1\n```\n\n#### Use helper methods to simplify your life\n```fortran\nprint \"(A)\", \" Vectorial distance\"\ncall distance%printf\nprint \"(A)\", \" Distance module\"\nprint*, distance%normL2()\n! expected output\n!   Vectorial distance\n!   Component x  0.000000000000000E+000\n!   Component y +0.200000000000000E+001\n!   Component z  0.000000000000000E+000\n!   Distance module\n!   +0.200000000000000E+001\n```\n\nAs you can see from the above example, defining and using a *vector* become very close to the mathematical formulation. Note that, using the dynamic dispatching resolved at compile time, there is no performance penalty on using a `type(vector)` variable instead of an *hard-coded* `real, dimension(3)` array variable (or even more verbose and less clear `real :: x, y, z` variables for each vector...).\n\nGo to [Top](#top)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszaghi%2Fvecfor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fszaghi%2Fvecfor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszaghi%2Fvecfor/lists"}