首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏Coxhuang

    Cpp(二) 创建Cpp工程

    文章目录 第一个Cpp例子 #1 环境 #2 概述 #3 开始 #3.1 方法一:Clion #3.2 方法二:手动创建 第一个Cpp例子 #1 环境 macOS 10.15.5 #2 概述 本文通过两种方式创建一个简单的 Cpp工程,对比两种方法的异同,这里不解释各个文件的作用,仅仅只是介绍两种创建Cpp工程的方法 #3 开始 GitHub例子:https://github.com/Coxhuang/FKCpp/tree 运行main.cpp #3.2 方法二:手动创建 创建如下文件 : build CMakeLists.txt main.cpp ? cmake_minimum_required(VERSION 3.16) project(demo) set(CMAKE_CXX_STANDARD 11) add_executable(demo_exe main.cpp ) main.cpp内容如下 : // // Created by Cox on 2020/8/30. // #include <iostream> int main() { std::cout

    1K30发布于 2020-11-07
  • BitNet.cpp llama.cpp对比

    简单来说,llama.cpp是兼顾兼容与性能的“全能选手”,而BitNet.cpp则是专为“极限压缩”设计的“特种兵”。 的降维打击极致压缩:BitNet.cpp将模型权重压缩至1-bit或1.58-bit(三值:-1,0,1),相比llama.cpp常见的4-bit/8-bit量化,内存占用直接砍掉70%-80%。 速度优势:得益于简化的计算逻辑(主要是加法而非乘法),BitNet.cpp在CPU上的推理速度通常是llama.cpp的2到6倍。 2.兼容性与生态:llama.cpp的全面统治模型自由:如果你需要尝试最新的开源模型(如Llama3,Qwen,DeepSeek等),llama.cpp是绝对首选。 硬件通吃:llama.cpp对GPU(CUDA/Metal/Vulkan)的支持非常成熟,能充分利用显卡加速。相比之下,BitNet.cpp目前主要优化在CPU端,对GPU的支持还在完善中。

    27610编辑于 2026-04-29
  • 来自专栏Coxhuang

    Cpp(十一) yaml-cpp的使用

    YamlCpp #1 环境 macOS 10.15.5 Cmake #2 安装 git clone git@gitee.com:Coxhuang/yaml-cpp.git cd yaml-cpp mkdir -D BUILD_SHARED_LIBS=ON make sudo make install 安装后,库文件和头文件路径: 头文件: /usr/local/include/yaml-cpp 库文件 : /usr/local/lib/libyaml-cpp.a #3 使用 #3.1 Cmake配置文件 cmake_minimum_required(VERSION 3.17) project(yaml_demo ) # 查找yaml-cpp link_directories( ${YAMLCPP_LIBRARY_DIRS} # 添加yaml-cpp库文件路径 ) add_executable(yaml_demo main.cpp) target_link_libraries(yaml_demo ${YAMLCPP_LIBRARIES} # 将yaml-cpp库连接到yaml_demo可执行文件中

    3.8K00发布于 2021-03-02
  • 来自专栏默认分类

    大数相加-cpp

    #include<iostream>#include<string>#include<algorithm>using namespace std;int main(){ string a,b,c; int length_a,length_b; cin>>a; cin>>b; length_a=a.length(); length_b=b.length(); reverse(a.begin(),a.end()); reverse(b.begin(),b.end(

    1.5K20编辑于 2023-02-06
  • cpp: Proxy Pattern

    #endif /*****************************************************************//** * \file GeovinDu.cpp **************************************************************//** * \file ConsoleDuProxyPattern.cpp 2023 *********************************************************************/ // ConsoleDuProxyPattern.cpp

    1300编辑于 2026-06-19
  • cpp: Memento Pattern

    #endif /*****************************************************************//** * \file GeovinDu.cpp ************************************************************//** * \file ConsoleDuMementoPattern.cpp *********************************************************************/ // ConsoleDuMementoPattern.cpp

    1000编辑于 2026-06-19
  • cpp: Mediator Pattern

    /*****************************************************************//** * \file GoldEditControl.cpp /*****************************************************************//** * \file GoldRadioButton.cpp /*****************************************************************//** * \file GeovinDu.cpp ***********************************************************//** * \file ConsoleDuMediatorPattern.cpp *********************************************************************/ // ConsoleDuMediatorPattern.cpp

    000编辑于 2026-06-19
  • cpp: Composite Pattern

    #endif /*****************************************************************//** * \file GeovinDu.cpp **********************************************************//** * \file ConsoleDuCompositePattern.cpp *****************************************************************/ // ConsoleDuCompositePattern.cpp **********************************************************//** * \file ConsoleDuCompositePattern.cpp *****************************************************************/ // ConsoleDuCompositePattern.cpp

    300编辑于 2026-06-19
  • 来自专栏全栈程序员必看

    leetcode #77 in cpp

    Given two integers n and k, return all possible combinations of k numbers out of 1 … n.

    65410编辑于 2022-11-10
  • 来自专栏javascript趣味编程

    SPlisHSPlasHSimulatorSimulatorBase.cpp

    mrk it up! #include "SimulatorBase.h" #include "SPlisHSPlasH/Utilities/SceneLoader.h" #include "Utilities/FileSystem.h" #include "SPlisHSPlasH/TimeManager.h" #include "Utilities/PartioReaderWriter.h" #include "SPlisHSPlasH/Emitter.h" #include "SPlisHSPlasH

    2.5K20发布于 2020-11-11
  • cpp: Singleton Pattern

    endif /*****************************************************************//** * \file GoldConfig.cpp 20 May 2023 *********************************************************************/ // GoldConfig.cpp ; namespace DuLazySingletonPattern { GoldConfig* GoldConfig::m_instance = nullptr; //在类外,某个.cpp 20 May 2023 *********************************************************************/ // GoldCommon.cpp 20 May 2023 *********************************************************************/ // GoldFunction.cpp

    300编辑于 2026-06-19
  • cpp:Interpreter Pattern

    endif /*****************************************************************//** * \file DuSimple.cpp endif /*****************************************************************//** * \file GoldSimple.cpp #endif /*****************************************************************//** * \file GeovinDu.cpp ********************************************************//** * \file ConsoleDuInterpreterPattern.cpp *******************************************************************/ // ConsoleDuInterpreterPattern.cpp

    2110编辑于 2026-06-18
  • cpp: Iterator Pattern

    endif /*****************************************************************//** * \file GeovinDu.cpp ***********************************************************//** * \file ConsoleDuIteratorPattern.cpp *********************************************************************/ // ConsoleDuIteratorPattern.cpp ***********************************************************//** * \file ConsoleDuIteratorPattern.cpp *********************************************************************/ // ConsoleDuIteratorPattern.cpp

    300编辑于 2026-06-19
  • cpp: Prototype Pattern

    /// /// void displayGold(); }; } #endif // GeovinDu.cpp GlobalCreateGold(pMonsterObj); delete pMonsterObj; } } 调用:、 // GeovinDu.cpp

    2610编辑于 2026-06-18
  • cpp: Flyweight Pattern

    endif /*****************************************************************//** * \file GeovinDu.cpp **********************************************************//** * \file ConsoleDuFlyweightPattern.cpp *******************************************************************/ // ConsoleDuFlyweightPattern.cpp

    2510编辑于 2026-06-18
  • cpp: Observer Pattern

    , string tmpName) :Gold(tmpID, tmpName) { cout << "店铺" << endl; } }; } #endif // GeovinDu.cpp summary> class GeovinDu { private: public: void displaySimple(); }; } #endif // GeovinDu.cpp pplayerobj2; delete pplayerobj3; delete pplayerobj4; } } 调用: // ConsoleDuObserverPattern.cpp // Observer Pattern 观察者模式 // ConsoleDuObserverPattern.cpp : 此文件包含 "ConsoleDuObserverPattern" 类。

    2010编辑于 2026-06-18
  • cpp:Adapter Pattern

    #endif /*****************************************************************//** * \file GeovinDu.cpp ************************************************************//** * \file ConsoleDuAdapterPattern.cpp *********************************************************************/ // ConsoleDuAdapterPattern.cpp

    5210编辑于 2026-06-18
  • cpp:State Pattern

    #endif /*****************************************************************//** * \file Gold.cpp ****************************************************************//** * \file GoldStatusStateless.cpp /*****************************************************************//** * \file GoldStatusSolid.cpp /*****************************************************************//** * \file GoldStatusSolid.cpp #endif /*****************************************************************//** * \file GeovinDu.cpp

    3910编辑于 2026-06-18
  • cpp: Strategy Pattern

    summary> /// 资源配置 (整合)resource allocation /// int Presource; }; } #endif // Gold.cpp : ///

    /// /// void displayUnabstract(); }; } #endif // GeovinDu.cpp delete pobjelm; delete pobjade; delete pobpearl; } } 调用: // ConsoleDuStrategyPattern.cpp

    000编辑于 2026-06-19
  • cpp: Bridge Pattern

    #endif /*****************************************************************//** * \file GeovinDu.cpp *************************************************************//** * \file ConsoleDuBridgePattern.cpp 2023 *********************************************************************/ // ConsoleDuBridgePattern.cpp

    2910编辑于 2026-06-18
领券