repo_name stringlengths 1 52 | repo_creator stringclasses 6
values | programming_language stringclasses 4
values | code stringlengths 0 9.68M | num_lines int64 1 234k |
|---|---|---|---|---|
orrb | openai | C# | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// JointRandomizer component assigns random positions to joints.
public class JointRandomizer : RendererComponent {
public override bool RunComponent(RendererComponent.IOutputContext context) {
JointController[] joint_controll... | 38 |
orrb | openai | C# | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// LightRandomizer randomizes total illumination of the scene and
// the parameters of individual lights. At first a random scene light
// intensity is drawn, then a random weight is drawn for each light and
// the total intensity is weight... | 96 |
orrb | openai | C# | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// This randomizer can be used to modify material appearance close
// to a calibrated value. The main idea is to use the HSV representation
// and separately randomize: hue, saturation and value. All three
// dimensions use separate randomi... | 269 |
orrb | openai | C# | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// MaterialRandomizer assigns random tint, texture and normal map
// to a subset of materials. It also modifies the material's
// glossiness and metallic properties that control how shading
// appears in the Unity PBR model. The textures an... | 172 |
orrb | openai | C# | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
// This randomizer applies a set of post-processing effects on top of the rendered images.
// There are several post-processing profiles, including color gradient, bloom, ambient
// occlusion a... | 302 |
orrb | openai | C# | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// LightingRig sets up lights in a programatic way and randomizes
// their positions. The rig arranges a number of new lights
// orbiting a specified center point. Mounting distance from the
// center point and the height above it can be se... | 136 |
orrb | openai | C# | using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using UnityEngine;
// ConfigUtilities provide a reflection based interoperation between the C# components and protocol
// buffer based RendererComponentConfig structures. The helper functions: Get/SetProperty allow easy
// extrac... | 213 |
orrb | openai | C# | using System;
using System.Collections.Generic;
using MIConvexHull;
using UnityEngine;
// This is a simple wrapper for the MIConvexHull. The static method CreateConvexHull takes a Unity Mesh
// and produces a Unity Mesh with the convex hull.
public class ConvexHull {
public static Mesh CreateConvexHull(Mesh me... | 47 |
orrb | openai | C# | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using System.IO;
using System.Reflection;
// This utility allows properties (class member variables) to be configured from commandline and
// property files. Use the Flag attribute to mark configurable variables. This utili... | 171 |
orrb | openai | C# | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// A simple utility used to unify logging. The time logged is measured in milliseconds relative to
// application startup. An Id and indent / alignment value can be provided in order to make logs
// from multiple servers visually align n... | 80 |
orrb | openai | C# | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SceneUtils {
// Create a named game object and attach a component to it.
public static T InstantiateWithController<T>(string name) where T : Component {
GameObject game_object = new GameObject();
ret... | 47 |
orrb | openai | C# | using System.Collections.Generic;
using UnityEngine;
using System.Xml;
// Utilities that support reading the MuJoCo XMLs and the property inheritance model that
// it uses.
public class XmlUtils {
public class Defaults {
public XmlNode root;
public XmlNode current;
public Defaults(Xml... | 256 |
orrb | openai | C# | // ===============================================================================================
// The MIT License (MIT) for UnityFBXExporter
//
// UnityFBXExporter was created for Building Crafter (http://u3d.as/ovC) a tool to rapidly
// create high quality buildings right in Unity with no need to use 3D model... | 611 |
orrb | openai | C# | // ===============================================================================================
// The MIT License (MIT) for UnityFBXExporter
//
// UnityFBXExporter was created for Building Crafter (http://u3d.as/ovC) a tool to rapidly
// create high quality buildings right in Unity with no need to use 3D model... | 326 |
orrb | openai | C# | // ===============================================================================================
// The MIT License (MIT) for UnityFBXExporter
//
// UnityFBXExporter was created for Building Crafter (http://u3d.as/ovC) a tool to rapidly
// create high quality buildings right in Unity with no need to use 3D model... | 502 |
orrb | openai | C# | // ===============================================================================================
// The MIT License (MIT) for UnityFBXExporter
//
// UnityFBXExporter was created for Building Crafter (http://u3d.as/ovC) a tool to rapidly
// create high quality buildings right in Unity with no need to use 3D model... | 161 |
orrb | openai | C# | using UnityEngine;
using System.Collections;
using UnityEditor;
public class ProceduralTest : MonoBehaviour
{
[MenuItem("Assets/FBX Exporter/Create Object With Procedural Texture", false, 43)]
public static void CreateObject()
{
GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
Texture2D te... | 22 |
retro | openai | C# | using System.Reflection;
using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("DotZLib")]
[assembly: AssemblyDescri... | 59 |
retro | openai | C# | //
// © Copyright Henrik Ravn 2004
//
// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace DotZLib
{
... | 202 |
retro | openai | C# | //
// © Copyright Henrik Ravn 2004
//
// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
using System;
using System.Diagnostics;
namespace DotZLib
{
/// <summary>
/// This class ... | 84 |
retro | openai | C# | //
// © Copyright Henrik Ravn 2004
//
// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
using System;
using System.Runtime.InteropServices;
namespace DotZLib
{
/// <summary>
/// ... | 199 |
retro | openai | C# | //
// © Copyright Henrik Ravn 2004
//
// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace DotZ... | 107 |
retro | openai | C# | //
// © Copyright Henrik Ravn 2004
//
// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
nam... | 289 |
retro | openai | C# | //
// © Copyright Henrik Ravn 2004
//
// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace DotZLib
{
//... | 302 |
retro | openai | C# | //
// © Copyright Henrik Ravn 2004
//
// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace DotZ... | 106 |
retro | openai | C# | //
// © Copyright Henrik Ravn 2004
//
// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
using System;
using System.Collections;
using System.IO;
// uncomment the define below to i... | 275 |
websockify | openai | C# | using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;
namespace MELT_Command_Websocket
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
{... | 25 |
websockify | openai | C# | using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;
namespace MELT_Command_Websocket
{
[RunInstaller(true)]
public partial class ProjectInstaller : System.Configuration.Install.Installer
{
... | 20 |
websockify | openai | C# | namespace MELT_Command_Websocket
{
partial class ProjectInstaller
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </sum... | 61 |
websockify | openai | C# | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.IO;
namespace MELT_Command_Websocket
{
public partial class Service1 : ServiceBase
{
Process webso... | 42 |
websockify | openai | C# | namespace MELT_Command_Websocket
{
partial class Service1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
... | 38 |
websockify | openai | C# | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("... | 37 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Numerics;
namespace Algorithms;
public static class NewtonSquareRoot
{
public static BigInteger Calculate(BigInteger number)
{
if (number < 0)
{
throw new ArgumentException("Cannot calculate the square root of a negative number.");
}
i... | 38 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Linq;
namespace Algorithms.DataCompression
{
/// <summary>
/// The Burrows–Wheeler transform (BWT) rearranges a character string into runs of similar characters.
/// This is useful for compression, since it tends to be easy to compress a string that has runs of repea... | 75 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
using System.Linq;
using Algorithms.Sorters.Comparison;
using Utilities.Extensions;
namespace Algorithms.DataCompression
{
/// <summary>
/// Greedy lossless compression algorithm.
/// </summary>
public class HuffmanCompressor
{
// TODO: Us... | 168 |
C-Sharp | TheAlgorithms | C# | using System.Collections.Generic;
using System.Linq;
using Algorithms.Knapsack;
using Utilities.Extensions;
namespace Algorithms.DataCompression
{
/// <summary>
/// Greedy lossless compression algorithm.
/// </summary>
public class ShannonFanoCompressor
{
private readonly IHeuristicKnap... | 135 |
C-Sharp | TheAlgorithms | C# | using System.Collections.Generic;
using System.Text;
namespace Algorithms.DataCompression
{
/// <summary>
/// TODO.
/// </summary>
public class Translator
{
/// <summary>
/// TODO.
/// </summary>
/// <param name="text">TODO. 2.</param>
/// <param n... | 36 |
C-Sharp | TheAlgorithms | C# | using System.Text;
namespace Algorithms.Encoders
{
/// <summary>
/// Encodes using caesar cypher.
/// </summary>
public class CaesarEncoder : IEncoder<int>
{
/// <summary>
/// Encodes text using specified key,
/// time complexity: O(n),
/// space comp... | 57 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
using System.Text;
namespace Algorithms.Encoders
{
/// <summary>
/// Encodes using Feistel cipher.
/// https://en.wikipedia.org/wiki/Feistel_cipher
/// In cryptography, a Feistel cipher (also known as Luby–Rackoff block cipher)
/// i... | 178 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Linq;
using Algorithms.Numeric;
namespace Algorithms.Encoders
{
/// <summary>
/// Lester S. Hill's polygraphic substitution cipher,
/// without representing letters using mod26, using
/// corresponding "(char)value" instead.
/// </summary>
public class ... | 193 |
C-Sharp | TheAlgorithms | C# | namespace Algorithms.Encoders
{
/// <summary>
/// Encodes and decodes text based on specified key.
/// </summary>
/// <typeparam name="TKey">Type of the key.</typeparam>
public interface IEncoder<TKey>
{
/// <summary>
/// Encodes text using specified key.
/// <... | 26 |
C-Sharp | TheAlgorithms | C# | using System.Globalization;
using System.Linq;
using System.Text;
namespace Algorithms.Encoders
{
/// <summary>
/// Class for NYSIIS encoding strings.
/// </summary>
public class NysiisEncoder
{
private static readonly char[] Vowels = { 'A', 'E', 'I', 'O', 'U' };
/// <summary>
... | 181 |
C-Sharp | TheAlgorithms | C# | using System.Collections.Generic;
using System.Linq;
namespace Algorithms.Encoders
{
/// <summary>
/// Class for Soundex encoding strings.
/// </summary>
public class SoundexEncoder
{
/// <summary>
/// Encodes a string using the Soundex Algorithm.
/// </summary>
... | 112 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Text;
namespace Algorithms.Encoders
{
/// <summary>
/// Encodes using vigenere cypher.
/// </summary>
public class VigenereEncoder : IEncoder<string>
{
private readonly CaesarEncoder caesarEncoder = new();
/// <summary>
/// Encodes text... | 72 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
using DataStructures.Graph;
namespace Algorithms.Graph
{
/// <summary>
/// Breadth First Search - algorithm for traversing graph.
/// Algorithm starts from root node that is selected by the user.
/// Algorithm explores all nodes at the present depth.
... | 60 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
using DataStructures.BinarySearchTree;
namespace Algorithms.Graph
{
/// <summary>
/// Breadth first tree traversal traverses through a binary tree
/// by iterating through each level first.
/// time complexity: O(n).
/// space complexi... | 91 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
using DataStructures.Graph;
namespace Algorithms.Graph
{
/// <summary>
/// Depth First Search - algorithm for traversing graph.
/// Algorithm starts from root node that is selected by the user.
/// Algorithm explores as far as possible along each branch b... | 51 |
C-Sharp | TheAlgorithms | C# | using System;
using DataStructures.Graph;
namespace Algorithms.Graph
{
/// <summary>
/// Floyd Warshall algorithm on directed weighted graph.
/// </summary>
/// <typeparam name="T">generic type of data in graph.</typeparam>
public class FloydWarshall<T>
{
/// <summary>
/// runs ... | 66 |
C-Sharp | TheAlgorithms | C# | using System;
using DataStructures.Graph;
namespace Algorithms.Graph
{
public interface IGraphSearch<T>
{
/// <summary>
/// Traverses graph from start vertex.
/// </summary>
/// <param name="graph">Graph instance.</param>
/// <param name="startVertex">Vertex that search ... | 17 |
C-Sharp | TheAlgorithms | C# | using System.Collections.Generic;
using System.Linq;
using DataStructures.Graph;
namespace Algorithms.Graph
{
/// <summary>
/// Implementation of Kosaraju-Sharir's algorithm (also known as Kosaraju's algorithm) to find the
/// strongly connected components (SCC) of a directed graph.
/// See https://en.... | 128 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
using System.Linq;
using DataStructures.Graph;
namespace Algorithms.Graph.Dijkstra
{
public static class DijkstraAlgorithm
{
/// <summary>
/// Implementation of the Dijkstra shortest path algorithm for cyclic graphs.
/// https://en.wiki... | 125 |
C-Sharp | TheAlgorithms | C# | using DataStructures.Graph;
namespace Algorithms.Graph.Dijkstra
{
/// <summary>
/// Entity which represents the Dijkstra shortest distance.
/// Contains: Vertex, Previous Vertex and minimal distance from start vertex.
/// </summary>
/// <typeparam name="T">Generic parameter.</typeparam>
publ... | 29 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
using DataStructures.DisjointSet;
namespace Algorithms.Graph.MinimumSpanningTree
{
/// <summary>
/// Algorithm to determine the minimum spanning forest of an undirected graph.
/// </summary>
/// <remarks>
/// Kruskal's algorithm is a greedy al... | 193 |
C-Sharp | TheAlgorithms | C# | using System;
namespace Algorithms.Graph.MinimumSpanningTree
{
/// <summary>
/// Class that uses Prim's (Jarnik's algorithm) to determine the minimum
/// spanning tree (MST) of a given graph. Prim's algorithm is a greedy
/// algorithm that can determine the MST of a weighted undirected grap... | 151 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
using System.Linq;
namespace Algorithms.Knapsack
{
/// <summary>
/// Branch and bound Knapsack solver.
/// </summary>
/// <typeparam name="T">Type of items in knapsack.</typeparam>
public class BranchAndBoundKnapsackSolver<T>
{
/// <su... | 166 |
C-Sharp | TheAlgorithms | C# | namespace Algorithms.Knapsack
{
public class BranchAndBoundNode
{
// isTaken --> true = the item where index = level is taken, vice versa
public bool IsTaken { get; }
// cumulativeWeight --> um of weight of item associated in each nodes starting from root to this node (only item that is... | 31 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
namespace Algorithms.Knapsack
{
/// <summary>
/// Dynamic Programming Knapsack solver.
/// </summary>
/// <typeparam name="T">Type of items in knapsack.</typeparam>
public class DynamicProgrammingKnapsackSolver<T>
{
/// <summary>
... | 102 |
C-Sharp | TheAlgorithms | C# | using System;
namespace Algorithms.Knapsack
{
/// <summary>
/// Solves knapsack problem using some heuristics
/// Sum of values of taken items -> max
/// Sum of weights of taken items. <= capacity.
/// </summary>
/// <typeparam name="T">Type of items in knapsack.</typeparam>
... | 26 |
C-Sharp | TheAlgorithms | C# | namespace Algorithms.Knapsack
{
/// <summary>
/// Solves knapsack problem:
/// to maximize sum of values of taken items,
/// while sum of weights of taken items is less than capacity.
/// </summary>
/// <typeparam name="T">Type of items in knapsack.</typeparam>
public interfac... | 13 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
namespace Algorithms.Knapsack
{
/// <summary>
/// Greedy heurictic solver.
/// </summary>
/// <typeparam name="T">Type of items in knapsack.</typeparam>
public class NaiveKnapsackSolver<T> : IHeuristicKnapsackSolver<T>
{
/// <summar... | 39 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Algorithms.LinearAlgebra.Distances
{
/// <summary>
/// Implementation for Euclidean distance.
/// </summary>
public static class Euclidean
{
/// <summary>
//... | 32 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Algorithms.LinearAlgebra.Distances
{
/// <summary>
/// Implementation fo Manhattan distance.
/// It is the sum of the lengths of the projections of the line segment between the poin... | 36 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Linq;
using Utilities.Extensions;
namespace Algorithms.LinearAlgebra.Eigenvalue
{
/// <summary>
/// Power iteration method - eigenvalue numeric algorithm, based on recurrent relation:
/// Li+1 = (A * Li) / || A * Li ||, where Li - eigenvector approximation.
/// </summ... | 88 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
namespace Algorithms.ModularArithmetic
{
/// <summary>
/// Chinese Remainder Theorem: https://en.wikipedia.org/wiki/Chinese_remainder_theorem.
/// </summary>
public static class ChineseRemainderTheorem
{
... | 194 |
C-Sharp | TheAlgorithms | C# | using System.Numerics;
namespace Algorithms.ModularArithmetic
{
/// <summary>
/// Extended Euclidean algorithm: https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm.
/// </summary>
public static class ExtendedEuclideanAlgorithm
{
/// <summary>
/// Computes the greatest... | 96 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Numerics;
namespace Algorithms.ModularArithmetic
{
/// <summary>
/// Modular multiplicative inverse: https://en.wikipedia.org/wiki/Modular_multiplicative_inverse.
/// </summary>
public static class ModularMultiplicativeInverse
{
/// <summary>
/// Compu... | 66 |
C-Sharp | TheAlgorithms | C# | using System;
namespace Algorithms.Numeric
{
/// <summary>
/// In number theory, the aliquot sum s(n) of a positive integer n is the sum of all proper divisors
/// of n, that is, all divisors of n other than n itself. For example, the proper divisors of 15
/// (that is, the positive divi... | 39 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Algorithms.Numeric
{
/// <summary>
/// Amicable numbers are two different natural numbers related in such a way that the sum of the proper divisors of
/// each is equal to the other... | 42 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
namespace Algorithms.Numeric
{
/// <summary>
/// Calculates Automorphic numbers. A number is said to be an Automorphic number
/// if the square of the number will contain the number itself at the end.
/// </summar... | 75 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Numerics;
namespace Algorithms.Numeric
{
/// <summary>
/// The binomial coefficients are the positive integers
/// that occur as coefficients in the binomial theorem.
/// </summary>
public static class BinomialCoefficient
{
/// <summary>
/// ... | 50 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
namespace Algorithms.Numeric
{
/// <summary>
/// In mathematics and computational science, the Euler method (also called forward Euler method)
/// is a first-order numerical procedure for solving ordinary differential equations (ODEs)
/// with... | 86 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Numerics;
namespace Algorithms.Numeric
{
/// <summary>
/// The factorial of a positive integer n, denoted by n!,
/// is the product of all positive integers less than or equal to n.
/// </summary>
public static class Factorial
{
/// <summary>
... | 40 |
C-Sharp | TheAlgorithms | C# | using System;
namespace Algorithms.Numeric
{
/// <summary>
/// Algorithm used to find the inverse of any matrix that can be inverted.
/// </summary>
public class GaussJordanElimination
{
private int RowCount { get; set; }
/// <summary>
/// Method to find a linear... | 154 |
C-Sharp | TheAlgorithms | C# | using System;
namespace Algorithms.Numeric;
public static class JosephusProblem
{
/// <summary>
/// Calculates the winner in the Josephus problem.
/// </summary>
/// <param name="n">The number of people in the initial circle.</param>
/// <param name="k">The count of each step. k-1 people are sk... | 34 |
C-Sharp | TheAlgorithms | C# | using System;
namespace Algorithms.Numeric
{
/// <summary>
/// In number theory, a Keith number or repfigit number is a natural number n in a given number base b with k digits such that
/// when a sequence is created such that the first k terms are the k digits of n and each subsequent term is the sum of... | 58 |
C-Sharp | TheAlgorithms | C# | using System;
namespace Algorithms.Numeric
{
/// <summary>
/// A Krishnamurthy number is a number whose sum of the factorial of digits
/// is equal to the number itself.
///
/// For example, 145 is a Krishnamurthy number since: 1! + 4! + 5! = 1 + 24 + 120 = 145.
/// </summary>
public static... | 39 |
C-Sharp | TheAlgorithms | C# | using System;
namespace Algorithms.Numeric
{
/// <summary>
/// Modular exponentiation is a type of exponentiation performed over a modulus
/// Modular exponentiation c is: c = b^e mod m where b is base, e is exponent, m is modulus
/// (Wiki: https://en.wikipedia.org/wiki/Modular_exponentiat... | 44 |
C-Sharp | TheAlgorithms | C# | using System;
namespace Algorithms.Numeric
{
/// <summary>
/// A Narcissistic number is equal to the sum of the cubes of its digits. For example, 370 is a
/// Narcissistic number because 3*3*3 + 7*7*7 + 0*0*0 = 370.
/// </summary>
public static class NarcissisticNumberChecker
{
... | 41 |
C-Sharp | TheAlgorithms | C# | using System;
namespace Algorithms.Numeric
{
/// <summary>
/// In number theory, a perfect number is a positive integer that is equal to the sum of its positive
/// divisors, excluding the number itself.For instance, 6 has divisors 1, 2 and 3 (excluding
/// itself), and 1 + 2 + 3 = 6, so... | 38 |
C-Sharp | TheAlgorithms | C# | using System;
namespace Algorithms.Numeric
{
/// <summary>
/// A perfect square is an element of algebraic structure that is equal to the square of another element.
/// </summary>
public static class PerfectSquareChecker
{
/// <summary>
/// Checks if a number is a perfect... | 27 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
namespace Algorithms.Numeric
{
/// <summary>
/// In numerical analysis, the Runge–Kutta methods are a family of implicit and explicit iterative methods,
/// used in temporal discretization for the approximate solutions of simultaneous nonlinear equa... | 70 |
C-Sharp | TheAlgorithms | C# | using System;
namespace Algorithms.Numeric.Decomposition
{
/// <summary>
/// LU-decomposition factors the "source" matrix as the product of lower triangular matrix
/// and upper triangular matrix.
/// </summary>
public static class Lu
{
/// <summary>
/// Performs LU-... | 115 |
C-Sharp | TheAlgorithms | C# | using System;
using Utilities.Extensions;
using M = Utilities.Extensions.MatrixExtensions;
using V = Utilities.Extensions.VectorExtensions;
namespace Algorithms.Numeric.Decomposition
{
/// <summary>
/// Singular Vector Decomposition decomposes any general matrix into its
/// singular values and a s... | 146 |
C-Sharp | TheAlgorithms | C# | namespace Algorithms.Numeric.Factorization
{
/// <summary>
/// Finds a factor of a given number or returns false if it's prime.
/// </summary>
public interface IFactorizer
{
/// <summary>
/// Finds a factor of a given number or returns false if it's prime.
/// </su... | 17 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Linq;
namespace Algorithms.Numeric.Factorization
{
/// <summary>
/// Factors number using trial division algorithm.
/// </summary>
public class TrialDivisionFactorizer : IFactorizer
{
/// <summary>
/// Finds the smallest non trivial factor (i.e.: 1... | 25 |
C-Sharp | TheAlgorithms | C# | using System;
namespace Algorithms.Numeric.GreatestCommonDivisor
{
/// <summary>
/// Finds greatest common divisor for numbers u and v
/// using binary algorithm.
/// Wiki: https://en.wikipedia.org/wiki/Binary_GCD_algorithm.
/// </summary>
public class BinaryGreatestCommonDivisorFin... | 72 |
C-Sharp | TheAlgorithms | C# | namespace Algorithms.Numeric.GreatestCommonDivisor
{
/// <summary>
/// TODO.
/// </summary>
public class EuclideanGreatestCommonDivisorFinder : IGreatestCommonDivisorFinder
{
/// <summary>
/// Finds greatest common divisor for numbers a and b
/// using euclidean a... | 42 |
C-Sharp | TheAlgorithms | C# | namespace Algorithms.Numeric.GreatestCommonDivisor
{
public interface IGreatestCommonDivisorFinder
{
int FindGcd(int a, int b);
}
}
| 8 |
C-Sharp | TheAlgorithms | C# | using System;
using Algorithms.Numeric.Decomposition;
using Utilities.Extensions;
namespace Algorithms.Numeric.Pseudoinverse
{
/// <summary>
/// The Moore–Penrose pseudo-inverse A+ of a matrix A,
/// is a general way to find the solution to the following system of linear equations:
/// ... | 47 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Linq;
namespace Algorithms.Numeric.Series
{
/// <summary>
/// Maclaurin series calculates nonlinear functions approximation
/// starting from point x = 0 in a form of infinite power series:
/// f(x) = f(0) + f'(0) * x + ... + (f'n(0) * (x ^ n)) / n! + ...,
///... | 141 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Algorithms.Other
{
/// <summary>
/// Almost all real complex decision-making task is described by more than one criterion.
/// There are different methods to select the best decisio... | 79 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Numerics;
namespace Algorithms.Other
{
/// <summary>
/// Fermat's prime tester https://en.wikipedia.org/wiki/Fermat_primality_test.
/// </summary>
public static class FermatPrimeChecker
{
/// <summary>
/// Checks if input number is a probable prime... | 47 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
using System.Drawing;
using System.Numerics;
namespace Algorithms.Other
{
/// <summary>
/// Flood fill, also called seed fill, is an algorithm that determines and
/// alters the area connected to a given node in a multi-dimensional array with
/// some ... | 100 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Algorithms.Other
{
/// <summary>
/// The Gaussian method (coordinate descent method) refers to zero-order methods in which only the value
/// of the function Q(X) at different point... | 81 |
C-Sharp | TheAlgorithms | C# | using System;
namespace Algorithms.Other
{
public static class GeoLocation
{
private const double EarthRadiusKm = 6371.01d;
/// <summary>
/// Calculates spherical distance between 2 points given their latitude, longitude coordinates.
/// https://www.movable-type.co.u... | 38 |
C-Sharp | TheAlgorithms | C# | using System.Text;
namespace Algorithms.Other
{
/// <summary>
/// Manually converts an integer of certain size to a string of the binary representation.
/// </summary>
public static class Int2Binary
{
/// <summary>
/// Returns string of the binary representation of given Int... | 92 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Globalization;
namespace Algorithms.Other
{
/// <summary>
/// Date of Easter calculated with Meeus's Julian algorithm.
/// The algorithm is described in Jean Meeus' <a href="https://archive.org/details/astronomicalalgorithmsjeanmeeus1991/page/n73/mode/2up">Astronomical Al... | 33 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Collections.Generic;
using System.Drawing;
using System.Numerics;
namespace Algorithms.Other
{
/// <summary>
/// The Koch snowflake is a fractal curve and one of the earliest fractals to
/// have been described. The Koch snowflake can be built up iteratively, in a
///... | 158 |
C-Sharp | TheAlgorithms | C# | using System;
namespace Algorithms.Other
{
/// <summary>
/// Luhn algorithm is a simple
/// checksum formula used to validate
/// a variety of identification numbers,
/// such as credit card numbers.
/// More information on the link:
/// https://en.wikipedia.org/w... | 75 |
C-Sharp | TheAlgorithms | C# | using System;
using System.Drawing;
namespace Algorithms.Other
{
/// <summary>
/// The Mandelbrot set is the set of complex numbers "c" for which the series
/// "z_(n+1) = z_n * z_n + c" does not diverge, i.e. remains bounded. Thus, a
/// complex number "c" is a member of the Mandelbrot set... | 178 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.