repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
RNG65536/MCRT
src/examples/vcm/vcm_misc.h
// Disclaimer: This demo is adapted from smallvcm http://www.smallvcm.com/ #pragma once #include "film.h" class EyeLight { public: uint32_t m_maxPathLength; uint32_t m_minPathLength; uint32_t m_iterations; FrameBuffer m_framebuffer; const Scene_debug& m_...
RNG65536/MCRT
src/core/acceleration/bvh.h
#pragma once // median split BVH #include <cassert> #include <iostream> #include <memory> #include <string> #include <vector> #include "aabb.h" #include "boundedtriangle.h" #include "constants.h" #include "intersection.h" #include "logger.h" #include "numeric.h" #include "triangle.h" struct BVHTriangleReference { ...
RNG65536/MCRT
src/core/aabb.h
#pragma once #include "intersection.h" #include "ray.h" #include "vectors.h" class TriangleObject; class BoundedTriangle; // axis aligned bounding box class AABB { public: AABB(); AABB(const float3& min, const float3& max); AABB(const AABB& aabb); AABB& operator=(const AABB& aabb); const float3...
RNG65536/MCRT
src/core/camera.h
<reponame>RNG65536/MCRT<gh_stars>1-10 #pragma once #include "ray.h" #include "vectors.h" // pinhole camera model class Vert; class Camera { public: Camera(const vec3& origin, const vec3& lookat, const vec3& up, int film_width, int film_height, ...
RNG65536/MCRT
src/core/light.h
<filename>src/core/light.h<gh_stars>1-10 #ifndef light_h__ #define light_h__ #include "geometry.h" #include "vectors.h" class SceneSphere; // grabbed from smallvcm // http://www.smallvcm.com/ class AbstractLight { public: /* \brief Illuminates a given point in the scene. * * Given a point and two rando...
RNG65536/MCRT
src/core/film.h
#pragma once #include <vector> #include "vectors.h" class FrameBuffer { public: FrameBuffer(); FrameBuffer(int w, int h); ~FrameBuffer(); void resize(int w, int h); void scale(float s); void accumulatePixel(int i, int j, const vec3& c); void accumulateBuffer(const FrameBuffer& f); vo...
RNG65536/MCRT
src/core/envmap.h
#pragma once #include <vector> // envmap lighting and sampling struct DirLight { float dir[3]; float rad[3]; // pre-multiplied with 1/pdf float pdf; }; class DiscreteSampler; class EnvmapLoader { // u for selecting column, v for selecting row struct EnvmapHeader { int width, heigh...
RNG65536/MCRT
src/core/acceleration/sahbvh.h
<gh_stars>1-10 #pragma once // SAH BVH using binning #include <cassert> #include <iostream> #include <memory> #include <string> #include <vector> #include "aabb.h" #include "logger.h" #include "triangle.h" #include "constants.h" #include "numeric.h" #define DEBUG_BINS 0 #define DEBUG_INFO 0 constexpr int k_leaf_n...
RNG65536/MCRT
src/core/sample.h
#pragma once #include <random> #include <stack> #include <vector> #include "vectors.h" class RandomNumberGenerator { std::uniform_real_distribution<float> _dist; std::default_random_engine _rng; public: RandomNumberGenerator(); float randf(); }; class DiscreteSampler { std::vector<flo...
RNG65536/MCRT
src/core/consoledebug.h
<filename>src/core/consoledebug.h #pragma once #include <string> #include <iostream> class vec3; void debugPrint(const vec3& a); std::string str(const vec3& v); std::string str(int i); std::string str(float f);
RNG65536/MCRT
src/core/numeric.h
#pragma once // utilities class vec3; // not thread-safe float randf(); float randfFast(); float f_min(float a, float b); float f_max(float a, float b); int i_min(int a, int b); int i_max(int a, int b); float clampf(float x, float a, float b); // square float sq(float x); // compensated summation struct TKaha...
RNG65536/MCRT
src/examples/photonmap/photonmap.h
#ifndef photonmap_h__ #define photonmap_h__ //------------------------------------------------------------------ // photonmap.cpp // An example implementation of the photon map data structure // // <NAME> - February 2001 //------------------------------------------------------------------ #include <stdio.h> #include ...
RNG65536/MCRT
src/core/scenebvh.h
#pragma once #include <vector> #include "intersection.h" #include "triangle.h" class Ray; // scene traversal with acceleration structure class SceneBVH { public: SceneBVH(const std::vector<TriangleObject>& triangles); ~SceneBVH(); HitInfo intersect(const Ray& ray) const; bool occluded(const Ray&...
RNG65536/MCRT
src/core/vectors.h
<filename>src/core/vectors.h<gh_stars>1-10 #pragma once #include <cstdint> // custom vector and operators class vec3 { public: friend vec3 operator*(float a, const vec3& b); vec3(); explicit vec3(float a); vec3(float x, float y, float z); vec3 operator+(const float& v) const; vec3 ...
RNG65536/MCRT
src/core/intersection.h
<filename>src/core/intersection.h #pragma once #include "vectors.h" // intersection record class TriangleObject; class HitInfo { public: HitInfo(); HitInfo(float t, float u, float v, const vec3& nl, con...
RNG65536/MCRT
src/core/logger.h
<gh_stars>1-10 #pragma once #include <NanoLog.hpp> #include <iostream> #include <memory> #include <sstream> #include <functional> // for console output, use std::endl // for logger output, endl is automatically handled class Logger { public: static std::ostream& carriage_return(std::ostream& os) { os ...
RNG65536/MCRT
src/core/material.h
#pragma once #include "vectors.h" // materials (to be deprecated) typedef enum { LGHT, DIFF, SPEC, REFR, GLSY, PHNG, VOLM, SSSS } MaterialType; class AbstractBSDF; // TODO : integrate bsdf into this class (esp. API) class Material { public: Material() = default; Material(const Material& mat); Material&...
RNG65536/MCRT
src/examples/bdpt/bdpt_impl.h
#ifndef bdpt_h__ #define bdpt_h__ #include <vector> #include "camera.h" #include "consoledebug.h" #include "film.h" #include "geometry.h" #include "intersection.h" #include "lightpath.h" #include "material.h" #include "numeric.h" #include "sample.h" #include "scene.h" #include "triangle.h" // reference BDPT implement...
RNG65536/MCRT
src/core/lightpath.h
#pragma once #include "vectors.h" #define MinPathLength 1 #define MaxPathLength 11 // 9 // 10 #define MaxEvents (MaxPathLength + 1) typedef enum { FromEye, FromLight } PathType; typedef enum { Emitter, Diffuse, Specular, Lens } VertexType; class TriangleObject; // path data class Vert { private: char m_delt...
RNG65536/MCRT
src/core/mesh.h
#pragma once #include <glm/glm.hpp> #include <string> #include <vector> #include "vectors.h" // obj mesh loader class Mesh { public: Mesh(); std::vector<vec3> m_verts; std::vector<int3> m_faces; std::vector<vec3> m_vertex_normals; std::vector<float> m_vertex_alpha; Mesh(const std::string...
RNG65536/MCRT
src/core/triangle.h
<filename>src/core/triangle.h #pragma once #include "intersection.h" #include "ray.h" #include "vectors.h" // triangle object class AABB; class TriangleObject { public: int materialID() const; void setMaterialID(int id); void setVertexAlpha(const vec3& alpha); // for consistent normal const int& ...
RNG65536/MCRT
src/core/texture.h
<filename>src/core/texture.h<gh_stars>1-10 #pragma once class Texture { public: };
RNG65536/MCRT
src/core/ray.h
<gh_stars>1-10 #pragma once #include <string> #include "vectors.h" // ray class Ray { public: Ray(); // NOTE that additional dir info is recomputed Ray(const Ray& ray); Ray(const float3& o_, const float3& d_); Ray(const float3& o_, const float3& d_, float tmin, float tmax); // normalize di...
RNG65536/MCRT
src/examples/splitbvh/debug_mesh.h
#pragma once #include <vector> #include "triangle.h" #include "aabb.h" class DebugMesh { public: DebugMesh(); std::vector<Triangle>::const_iterator begin() const { return m_triangles.cbegin(); } std::vector<Triangle>::const_iterator end() const { return m_triangles.cend(); ...
RNG65536/MCRT
src/examples/vcm/vcm_material.h
// Disclaimer: This demo is adapted from smallvcm http://www.smallvcm.com/ #pragma once #include "vectors.h" #include "geometry.h" #include "ray.h" #include "sample.h" #include "constants.h" #include "numeric.h" class Material_debug { public: Material_debug() { Reset(); } void Reset() { ...
RNG65536/MCRT
src/core/scene.h
<filename>src/core/scene.h #pragma once #include <glm/glm.hpp> #include <unordered_map> #include "camera.h" #include "constants.h" #include "envmap.h" #include "intersection.h" #include "material.h" #include "ray.h" #include "sample.h" #include "triangle.h" #include "vectors.h" // scene management class SceneBVH; cl...
RNG65536/MCRT
src/core/boundedtriangle.h
<filename>src/core/boundedtriangle.h #pragma once #include <memory> #include "aabb.h" #include "triangle.h" // reference to a triangle that is bounded by a clipping aabb class BoundedTriangle { public: BoundedTriangle(const std::shared_ptr<Triangle>& triangle, const AABB& aabb); BoundedTriangle(const std::sh...
Bhaskers-Blu-Org2/DirectML
Samples/HelloDirectML/pch.h
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #define NOMINMAX #include <winrt/Windows.Foundation.h> #include "d3dx12.h" // The D3D12 Helper Library that you downloaded. #include <DirectML.h> // The DirectML header from the Windows SDK. #include <dxgi1...
oren12321/linear-algebra
include/math/core/allocators.h
<filename>include/math/core/allocators.h #ifndef MATH_CORE_ALLOCATORS_H #define MATH_CORE_ALLOCATORS_H #include <cstddef> #include <cstdlib> #include <cstdint> #include <new> #include <chrono> #include <utility> #include <type_traits> #include <concepts> #include <memory> #include <math/core/memory.h> namespace math...
oren12321/linear-algebra
include/math/core/algorithms.h
#ifndef MATH_ALGORITHMS_H #define MATH_ALGORITHMS_H #include <type_traits> #include <cmath> #include <limits> #include <memory> #include <math/core/allocators.h> namespace math::algorithms { template <typename T> concept Arithmetic = std::is_arithmetic_v<T>; template <Arithmetic T> bool is_equal(T a...
rhx/sds011udpbridge
sds011udpbridge.h
<filename>sds011udpbridge.h // // sds011udpbridge.h // sds011udpbridge // // Created by <NAME> on 12/1/17. // Copyright © 2017 <NAME>. All rights reserved. // #ifndef sds011udpbridge_h #define sds011udpbridge_h #include <stdbool.h> #include <sys/types.h> /// default broadcast port #define SDS011_BROADCAST_PORT ...
rhx/sds011udpbridge
sds011udpbridge.c
// // main.c // sds011udpbridge // // Created by <NAME> on 11/1/17. // Copyright © 2017 <NAME>. All rights reserved. // #include <string.h> #include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <libgen.h> #include <unistd.h> #include <signal.h> #include <errno.h> #include <poll.h> #include <sys/param....
galenguyer/gay
gay.c
<reponame>galenguyer/gay<gh_stars>1-10 #include <stdio.h> #include <stdlib.h> #include <string.h> struct color { int ansi; int xterm; int r; int g; int b; }; void set_ansi(int fg) { printf("\033[%d;%dm", fg, fg - 10); } void set_8bit(int color) { // foreground printf("\033[38;5;%dm", color); // backg...
saintwithataint/Pro-g-rammingChallenges4
Algorithmic/Easy/FizzBuzz/fizzbuzz.c
<gh_stars>1-10 #include <stdio.h> int main(void) { int i; for (i = 1; i <= 100; i++) { if (i % 15 == 0) { puts("FizzBuzz"); } else if (i % 3 == 0) { puts("Fizz"); } else if (i % 5 == 0) { puts("Buzz"); ...
saintwithataint/Pro-g-rammingChallenges4
Practical/Medium/Producer Consumer/pc.c
<filename>Practical/Medium/Producer Consumer/pc.c #include <stdio.h> #include <stdlib.h> int mutex = 1; int full = 0; int empty = 10; int x = 0; void prod() { --mutex, ++full, --empty, x++; printf("Producer: %d\n", x); ++mutex; } void cons() { --mutex, --full, ++empty; printf("Consumer: %d\n", x)...
larics/uav_ros_control
src/control/cvxgen/ldl.c
<filename>src/control/cvxgen/ldl.c /* Produced by CVXGEN, 2021-03-12 04:35:26 -0500. */ /* CVXGEN is Copyright (C) 2006-2017 <NAME>, <EMAIL>. */ /* The code in this file is Copyright (C) 2006-2017 <NAME>. */ /* CVXGEN, or solvers produced by CVXGEN, cannot be used for commercial */ /* applications without prior writte...
larics/uav_ros_control
src/control/cvxgen/testsolver.c
/* Produced by CVXGEN, 2021-03-12 04:35:32 -0500. */ /* CVXGEN is Copyright (C) 2006-2017 <NAME>, <EMAIL>. */ /* The code in this file is Copyright (C) 2006-2017 <NAME>. */ /* CVXGEN, or solvers produced by CVXGEN, cannot be used for commercial */ /* applications without prior written permission from <NAME>. */ /* Fi...
larics/uav_ros_control
src/control/cvxgen/matrix_support.c
<reponame>larics/uav_ros_control /* Produced by CVXGEN, 2021-03-12 04:35:30 -0500. */ /* CVXGEN is Copyright (C) 2006-2017 <NAME>, <EMAIL>. */ /* The code in this file is Copyright (C) 2006-2017 <NAME>. */ /* CVXGEN, or solvers produced by CVXGEN, cannot be used for commercial */ /* applications without prior written ...
larics/uav_ros_control
src/control/cvxgen/solver.c
<reponame>larics/uav_ros_control /* Produced by CVXGEN, 2021-03-12 04:35:31 -0500. */ /* CVXGEN is Copyright (C) 2006-2017 <NAME>, <EMAIL>. */ /* The code in this file is Copyright (C) 2006-2017 <NAME>. */ /* CVXGEN, or solvers produced by CVXGEN, cannot be used for commercial */ /* applications without prior written ...
zsx/renc-rs
renc-sys/wrapper.h
<filename>renc-sys/wrapper.h #include "renc/shim/valist.c" //#include "renc/include/rebol.h"
zsx/renc-rs
renc-sys/test/rebol.c
#include <stdlib.h> #include <stdio.h> #include <assert.h> #include "rebol.h" int main () { RL_rebStartup(); REBVAL *one = RL_rebInteger(1); #ifdef GOOD assert(1 == rebUnboxInteger(one)); #else assert(1 == RL_rebUnboxInteger0(one)); #endif rebRelease(one); RL_rebShutdown(1); return 0; }
xzrunner/ce
include/archgraph/op/ShapeO.h
#pragma once #include "archgraph/Operation.h" #include <SM_Vector.h> namespace archgraph { namespace op { class ShapeO : public Operation { public: enum OutputID { OUT_SHAPE = 0, OUT_REMAINDER, }; public: ShapeO() { m_imports = { {{ OpVarType::Any, "in" }}, ...
xzrunner/ce
include/archgraph/op/Center.h
<filename>include/archgraph/op/Center.h #pragma once #include "archgraph/Operation.h" #include <SM_Vector.h> namespace archgraph { namespace op { class Center : public Operation { public: Center() { m_imports = { {{ OpVarType::Any, "in" }}, }; m_exports = { {{...
xzrunner/ce
include/archgraph/EvalOp.h
#pragma once #include "archgraph/typedef.h" #include "archgraph/Operation.h" #include "archgraph/EvalContext.h" namespace ur { class Device; } namespace archgraph { class EvalRule; class EvalOp { public: EvalOp(std::function<void(const ur::Device&, const std::vector<GeoPtr>&, void*)> execute_cb = nullptr); ...
xzrunner/ce
include/archgraph/Operation.h
#pragma once #include "archgraph/typedef.h" #include "archgraph/OpVarType.h" #include "archgraph/Rule.h" #include <dag/Node.h> #include <cga/typedef.h> namespace archgraph { class Geometry; class EvalContext; class Operation : public dag::Node<OpVarType> { public: Operation(); virtual void Execute(const s...
xzrunner/ce
include/archgraph/op/PrimQuad.parm.h
#ifndef PARAM_INFO #error "You must define PARAM_INFO macro before include this file" #endif PARAM_INFO(Width, float, width, m_width, (1.0f)) PARAM_INFO(Length, float, length, m_length, (1.0f))
xzrunner/ce
include/archgraph/op/Switch.h
<reponame>xzrunner/ce #pragma once #include "archgraph/Operation.h" #include <SM_Vector.h> namespace archgraph { namespace op { class Switch : public Operation { public: Switch() { m_imports = { {{ OpVarType::Any, "in" }}, }; m_exports = { {{ OpVarType::Any, "...
xzrunner/ce
include/archgraph/op/Offset.h
#pragma once #include "archgraph/Operation.h" #include <SM_Vector.h> namespace archgraph { namespace op { class Offset : public Operation { public: enum class Selector { All, Inside, Border, }; public: Offset() { m_imports = { {{ OpVarType::Any, "in" ...
xzrunner/ce
include/archgraph/op_regist_cfg.h
#ifndef EXE_FILEPATH #error "You must define EXE_FILEPATH macro before include this file" #endif // creation #define PARM_OP_CLASS Extrude #define PARM_OP_NAME extrude #include EXE_FILEPATH #define PARM_OP_CLASS Insert #define PARM_OP_NAME i #include EXE_FILEPATH #define PARM_OP_CLASS PrimCube #define PARM_OP_NAME ...
xzrunner/ce
test/utility.h
<filename>test/utility.h #pragma once #include <SM_Vector.h> #include <archgraph/typedef.h> #include <map> #include <vector> namespace test { void init(); void check_aabb(const archgraph::Geometry& geo, const sm::vec3& min, const sm::vec3& max); void check_aabb_holes(const archgraph::Geometry& geo, const sm::vec3&...
xzrunner/ce
include/archgraph/EvalHelper.h
#pragma once #include "archgraph/VarType.h" #include "archgraph/typedef.h" #include <cga/typedef.h> #include <rttr/type.h> namespace archgraph { struct RelativeFloat; class EvalContext; class EvalHelper { public: static bool SetPropVal(rttr::property prop, rttr::instance obj, const VarPtr& val); ...
xzrunner/ce
include/archgraph/ArchGraph.h
<filename>include/archgraph/ArchGraph.h<gh_stars>0 #pragma once #include <cu/cu_macro.h> #include <memory> namespace cga { class StringPool; } namespace archgraph { class ArchGraph { public: auto GetStringPool() const { return m_str_pool; } private: std::shared_ptr<cga::StringPool> m_str_pool = nullptr; ...
xzrunner/ce
include/archgraph/op/PrimCube.parm.h
#ifndef PARAM_INFO #error "You must define PARAM_INFO macro before include this file" #endif PARAM_INFO(Width, float, width, m_width, (1.0f)) PARAM_INFO(Height, float, height, m_height, (1.0f)) PARAM_INFO(Depth, float, depth, m_depth, (1.0f))
xzrunner/ce
include/archgraph/op/Set.h
<reponame>xzrunner/ce<filename>include/archgraph/op/Set.h #pragma once #include "archgraph/Operation.h" namespace archgraph { namespace op { class Set : public Operation { public: Set() { m_imports = { {{ OpVarType::Any, "in" }}, }; m_exports = { {{ OpVarType::...
xzrunner/ce
include/archgraph/op/Set.parm.h
<gh_stars>0 #ifndef PARAM_INFO #error "You must define PARAM_INFO macro before include this file" #endif PARAM_INFO(Attribute, std::string, attribute, m_attr, ()) PARAM_INFO(Value, std::string, value, m_value, ())
xzrunner/ce
include/archgraph/EvalRule.h
<gh_stars>0 #pragma once #include "archgraph/typedef.h" #include "archgraph/Rule.h" #include "archgraph/EvalContext.h" #include <cga/typedef.h> #include <map> #include <memory> #include <vector> #include <sstream> namespace archgraph { class EvalRule { public: EvalRule() {} void AddRule(const RulePtr& rul...
xzrunner/ce
include/archgraph/Geometry.h
<filename>include/archgraph/Geometry.h<gh_stars>0 #pragma once #include <SM_Vector.h> #include <polymesh3/Polytope.h> namespace archgraph { class Variant; class Geometry { public: Geometry(const pm3::PolytopePtr& poly) : m_poly(poly) { m_color.MakeInvalid(); } Geometry(const std::ve...
xzrunner/ce
include/archgraph/RelativeFloat.h
<filename>include/archgraph/RelativeFloat.h #pragma once namespace archgraph { struct RelativeFloat { float value = 0; bool relative = true; RelativeFloat() {} RelativeFloat(float value, bool relative = true) : value(value), relative(relative) {} bool operator != (const RelativeFloat...
xzrunner/ce
include/archgraph/op/Extrude.parm.h
<reponame>xzrunner/ce #ifndef PARAM_INFO #error "You must define PARAM_INFO macro before include this file" #endif PARAM_INFO(Type, archgraph::op::Extrude::ExtrusionType, type, m_type, (archgraph::op::Extrude::ExtrusionType::FaceNormal)) PARAM_INFO(Distance, float, distance, m_dis...
xzrunner/ce
include/archgraph/FuncRegister.h
<filename>include/archgraph/FuncRegister.h<gh_stars>0 #pragma once #include "archgraph/typedef.h" #include <cu/cu_macro.h> #include <map> #include <string> namespace archgraph { class Function; class FuncRegister { public: FuncPtr QueryFunc(const std::string& name) const; FuncPtr QueryAttrFunc(const std::...
xzrunner/ce
include/archgraph/OpVarType.h
#pragma once namespace archgraph { enum class OpVarType { Any, Primitive, }; }
xzrunner/ce
include/archgraph/op/Insert.parm.h
<gh_stars>0 #ifndef PARAM_INFO #error "You must define PARAM_INFO macro before include this file" #endif PARAM_INFO(GeoPath, std::string, geo_path, m_geo_path, ()) PARAM_INFO(UpAxisOfGeo, archgraph::op::Insert::UpAxisOfGeo, up_axis, m_up_axis, (archgraph::op::Insert::UpAxisOfGeo...
xzrunner/ce
include/archgraph/ShapeAttrFuncs.h
#pragma once #include "archgraph/Function.h" namespace archgraph { namespace func { // scope attribute class ScopeSizeX : public Function { public: virtual VarPtr Eval(const std::vector<VarPtr>& parms, const std::vector<GeoPtr>& geos, std::ostream& console) const override; }; // ScopeSizeX } }
xzrunner/ce
include/archgraph/Function.h
<filename>include/archgraph/Function.h #pragma once #include "archgraph/typedef.h" #include <vector> namespace archgraph { class Function { public: virtual VarPtr Eval(const std::vector<VarPtr>& parms, const std::vector<GeoPtr>& geos, std::ostream& console) const = 0; }; // Function }
xzrunner/ce
include/archgraph/op/Comp.parm.h
#ifndef PARAM_INFO #error "You must define PARAM_INFO macro before include this file" #endif PARAM_INFO(Type, archgraph::op::Comp::Type, type, m_type, (archgraph::op::Comp::Type::Faces)) PARAM_INFO(Selector, std::vector<archgraph::op::Comp::Selector>, selectors, m_selectors, ())
xzrunner/ce
include/archgraph/op/Switch.parm.h
#ifndef PARAM_INFO #error "You must define PARAM_INFO macro before include this file" #endif PARAM_INFO(CaseExprStrings, std::vector<std::string>, case_expr_strs, m_case_expr_strs, ({""}))
xzrunner/ce
include/archgraph/op/ShapeO.parm.h
#ifndef PARAM_INFO #error "You must define PARAM_INFO macro before include this file" #endif PARAM_INFO(FrontWidth, float, front_width, m_front_width, (0.0f)) PARAM_INFO(RightWidth, float, right_width, m_right_width, (0.0f)) PARAM_INFO(BackWidth, float, back_width, m_back_width, (0.0f)) PARAM_INFO(LeftWidth, float...
xzrunner/ce
include/archgraph/op/TransScope.parm.h
<reponame>xzrunner/ce #ifndef PARAM_INFO #error "You must define PARAM_INFO macro before include this file" #endif PARAM_INFO(TransX, archgraph::RelativeFloat, tx, m_tx, ()) PARAM_INFO(TransY, archgraph::RelativeFloat, ty, m_ty, ()) PARAM_INFO(TransZ, archgraph::RelativeFloat, tz, m_tz, ())
xzrunner/ce
include/archgraph/op/PrimPoly.parm.h
#ifndef PARAM_INFO #error "You must define PARAM_INFO macro before include this file" #endif PARAM_INFO(Vertices, std::vector<sm::vec2>, vertices, m_vertices, ())
xzrunner/ce
include/archgraph/TopoPolyAdapter.h
<reponame>xzrunner/ce #pragma once #include <SM_Vector.h> #include <SM_Matrix.h> #include <polymesh3/Polytope.h> #include <vector> #include <memory> namespace he { class Polygon; } namespace archgraph { class TopoPolyAdapter { public: TopoPolyAdapter(const std::vector<sm::vec3>& border); auto& GetPoly() c...
xzrunner/ce
include/archgraph/op/Offset.parm.h
<reponame>xzrunner/ce<filename>include/archgraph/op/Offset.parm.h #ifndef PARAM_INFO #error "You must define PARAM_INFO macro before include this file" #endif PARAM_INFO(Selector, archgraph::op::Offset::Selector, selector, m_selector, (archgraph::op::Offset::Selector::All)) PARAM_INFO(Distance, float, ...
xzrunner/ce
include/archgraph/op/Split.parm.h
#ifndef PARAM_INFO #error "You must define PARAM_INFO macro before include this file" #endif PARAM_INFO(Axis, archgraph::op::Split::Axis, axis, m_axis, (archgraph::op::Split::Axis::X)) PARAM_INFO(Parts, std::vector<archgraph::op::Split::Part>, parts, m_parts, ()) PARAM_INFO(Repeat, bool, ...
xzrunner/ce
include/archgraph/op/Split.h
<reponame>xzrunner/ce<filename>include/archgraph/op/Split.h #pragma once #include "archgraph/Operation.h" #include <SM_Vector.h> #include <halfedge/typedef.h> namespace archgraph { namespace op { class Split : public Operation { public: enum class Axis { X, Y, Z }; enum clas...
xzrunner/ce
include/archgraph/Rule.h
#pragma once #include "archgraph/typedef.h" #include <cga/typedef.h> #include <vector> #include <memory> #include <map> namespace archgraph { class Operation; class EvalContext; class Rule { public: struct Operator; using OpPtr = std::shared_ptr<Operator>; struct Selector { enum class Typ...
xzrunner/ce
include/archgraph/op_include_gen.h
<reponame>xzrunner/ce #define XSTR(s) STR(s) #define STR(s) #s #ifndef PARM_OP_CLASS #error "You must define PARM_OP_CLASS macro before include this file" #endif #ifndef PARM_FILEPATH_H #define PARM_FILEPATH_H archgraph/op/##PARM_OP_CLASS##.h #endif #include XSTR(PARM_FILEPATH_H) #undef PARM_OP_NAME #undef PARM_OP_...
xzrunner/ce
include/archgraph/EvalExpr.h
#pragma once #include "archgraph/typedef.h" #include <cga/typedef.h> #include <memory> namespace archgraph { class EvalContext; class EvalExpr { public: static VarPtr Eval(const cga::ExprNodePtr& expr, const EvalContext& ctx, const GeoPtr& geo = nullptr); static VarPtr EvalNoExpand(const cga::Exp...
xzrunner/ce
include/archgraph/op/Color.parm.h
#ifndef PARAM_INFO #error "You must define PARAM_INFO macro before include this file" #endif PARAM_INFO(Color, sm::vec3, color, m_color, (1.0f, 1.0f, 1.0f))
xzrunner/ce
include/archgraph/Variant.h
#pragma once #include "archgraph/VarType.h" #include <string> namespace archgraph { class Variant { public: virtual VarType Type() const = 0; }; // Variant class BoolVar : public Variant { public: explicit BoolVar(bool b) : m_val(b) {} virtual VarType Type() const override { return VarType::Bo...
xzrunner/ce
include/archgraph/op/Scale.parm.h
<gh_stars>0 #ifndef PARAM_INFO #error "You must define PARAM_INFO macro before include this file" #endif PARAM_INFO(ScaleX, archgraph::RelativeFloat, sx, m_sx, ()) PARAM_INFO(ScaleY, archgraph::RelativeFloat, sy, m_sy, ()) PARAM_INFO(ScaleZ, archgraph::RelativeFloat, sz, m_sz, ())
xzrunner/ce
include/archgraph/VarType.h
<reponame>xzrunner/ce<filename>include/archgraph/VarType.h<gh_stars>0 #pragma once namespace archgraph { enum class VarType { Boolean, Float, String, }; }
xzrunner/ce
include/archgraph/BuildInFuncs.h
#pragma once #include "archgraph/Function.h" namespace archgraph { namespace func { class Print : public Function { public: virtual VarPtr Eval(const std::vector<VarPtr>& parms, const std::vector<GeoPtr>& geos, std::ostream& console) const override; private: static void PrintVar(const VarPtr& var, c...
xzrunner/ce
include/archgraph/op/Scale.h
#pragma once #include "archgraph/Operation.h" #include "archgraph/EvalExpr.h" #include "archgraph/RelativeFloat.h" namespace archgraph { namespace op { class Scale : public Operation { public: Scale() { m_imports = { {{ OpVarType::Any, "in" }}, }; m_exports = { ...
xzrunner/ce
include/archgraph/EvalContext.h
<reponame>xzrunner/ce<filename>include/archgraph/EvalContext.h<gh_stars>0 #pragma once #include <dag/Variable.h> #include <cga/typedef.h> #include <vector> namespace archgraph { class EvalContext { public: struct Parm { Parm() {} Parm(const std::string& name, const dag::Variable& value); ...
xzrunner/ce
include/archgraph/typedef.h
#pragma once #include <memory> namespace archgraph { class Operation; using OpPtr = std::shared_ptr<Operation>; class Geometry; using GeoPtr = std::shared_ptr<Geometry>; class Rule; using RulePtr = std::shared_ptr<Rule>; class Function; using FuncPtr = std::shared_ptr<Function>; class Variant; using VarPtr = std...
xzrunner/ce
include/archgraph/RuleLoader.h
#pragma once #include "archgraph/Rule.h" #include <cga/typedef.h> #include <string> #include <map> #include <vector> namespace cga { struct ExpressionNode; struct StatementNode; class Parser; class StringPool; } namespace archgraph { class EvalRule; class RuleLoader { public: RuleLoader(const...
xzrunner/ce
include/archgraph/op/Comp.h
#pragma once #include "archgraph/Operation.h" namespace archgraph { namespace op { class Comp : public Operation { public: enum class Type { Faces, Edges, FaceEdges, Vertices, Groups, Materials, Holes, }; enum class Selector { // Th...
MbedCraft/mc_btplayer
main/src/btplayer.c
#include <stdio.h> #include <string.h> #include "esp_console.h" #include "esp_event.h" #include "esp_log.h" #include "esp_netif.h" #include "esp_system.h" #include "mc_bt.h" #include "mc_fs.h" #include "mc_nvs.h" #include "app_console.h" #include "app_btplayer.h" const char _mount_path[] = "/data"; void app_main(v...
MbedCraft/mc_btplayer
main/src/app_console.c
<filename>main/src/app_console.c<gh_stars>0 /* ------------------------------------------------------------------------- *\ * Standard Includes * ------------------------------------------------------------------------- */ #include <stdio.h> #include <string.h> /* ----------------------------------------------------...
MbedCraft/mc_btplayer
main/inc/app_btplayer.h
<reponame>MbedCraft/mc_btplayer #pragma once #include <stddef.h> void app_btplayer_i2s_config( int sample_rate, int bits_per_sample, int channels); void app_byplayer_i2s_send_data(const uint8_t *buf, uint32_t len); void app_btplayer_init(const char * const mount_path, size_t mount_path_size); ...
MbedCraft/mc_btplayer
main/inc/app_console.h
<gh_stars>0 #if !defined __APP_CONSOLE_H__ # define __APP_CONSOLE_H__ void app_console_init(const char * const mount_path, size_t mount_path_size); #endif // __APP_CONSOLE_H__
MbedCraft/mc_btplayer
main/src/app_btplayer.c
/* ------------------------------------------------------------------------- *\ * Standard Includes * ------------------------------------------------------------------------- */ #include <string.h> /* ------------------------------------------------------------------------- *\ * Espressif specific includes * ----...
dxinteractive/xmas-steps
xmas.h
#include "Arduino.h" class Xmas { public: void setup(); void loop(); //Ledset ledset[3]; //int brightness = 255; };
cvxgrp/coneos
coneOSsparse/cs.c
<filename>coneOSsparse/cs.c #include "cs.h" #include "coneOS.h" /* NB: this is a subset of the routines in the CSPARSE package by <NAME>. al., for the full package please visit http://www.cise.ufl.edu/research/sparse/CSparse/ */ #define CS_MAX(a,b) (((a) > (b)) ? (a) : (b)) #define CS_MIN(a,b) (((a) < (b)) ? (a)...
cvxgrp/coneos
coneOSdense/cones.c
#include "cones.h" #ifdef LAPACK_LIB_FOUND #include <cblas.h> #include <lapacke.h> #endif void projectsdc(double * X, int n, Work * w); /* in place projection (with branches) */ void projCone(double *x, Cone * k, Work * w) { int i; int count; /* project onto positive orthant */ for(i = k->f; i < k->f+k->l; ++i) ...
cvxgrp/coneos
coneOSsparse/util.c
#include "util.h" #include <sys/time.h> static struct timeval tic_timestart; void tic(void) { gettimeofday(&tic_timestart, NULL); } double tocq(void) { struct timeval tic_timestop; gettimeofday(&tic_timestop, NULL); //coneOS_printf("time: %8.4f seconds.\n", (float)(tic_timestop - tic_timestart)); double time = ...
cvxgrp/coneos
coneOSdense/coneOS.h
#ifndef coneOS_H_GUARD #define coneOS_H_GUARD // redefine printfs and memory allocators as needed #ifdef MATLAB_MEX_FILE #include "mex.h" #define coneOS_printf mexPrintf #define coneOS_free mxFree #define coneOS_malloc mxMalloc #define con...
cvxgrp/coneos
coneOSdense/indirect/private.h
#ifndef PRIV_H_GUARD #define PRIV_H_GUARD #include "coneOS.h" #include "cblas.h" struct PRIVATE_DATA{ double * x; double * p; double * r; double * Ap; /* Gram matrix */ double * G; }; //Work * initWork(Data* d); //void formQ(Data * d, Work * w); ...
cvxgrp/coneos
coneOSsparse/cones.c
<reponame>cvxgrp/coneos<filename>coneOSsparse/cones.c #include "cones.h" #ifdef LAPACK_LIB_FOUND #include <cblas.h> #include <lapacke.h> #endif void projectsdc(double * X, int n, Work * w); /* in place projection (with branches) */ void projCone(double *x, Cone * k, Work * w, int iter) { int i; int count; ...
cvxgrp/coneos
coneOSsparse/direct/private.c
#include "private.h" // forward declare int LDLInit(cs * A, int P[], double **info); int LDLFactor(cs * A, int P[], int Pinv[], cs ** L, double **D); void LDLSolve(double *x, double b[], cs * L, double D[], int P[], double * bp); int factorize(Data * d,Work * w); void freePriv(Work * w){ cs_spfree(w->p->L);coneOS_fr...
cvxgrp/coneos
coneOSdense/python/coneOSmodule.c
<reponame>cvxgrp/coneos #include <Python.h> #include "coneOS.h" #include "numpy/arrayobject.h" // TODO: when normalizing, make a copy /* WARNING: this code uses numpy array types * * WARNING: this code also does not check that the data for the matrix A is * actually column compressed storage for a sparse matrix. i...